public void addWithProgress(final Collection<? extends VirtualFile> files) {
    if (files.size() >= HgUtil.MANY_FILES) {
      new Task.Backgroundable(myProject, HgBundle.message("hg4idea.add.progress"), true) {
        @Override
        public void run(@NotNull ProgressIndicator indicator) {
          indicator.setIndeterminate(false);
          executeInCurrentThread(files, indicator);
        }
      }.queue();
    }
    else {
      BackgroundTaskUtil.executeOnPooledThread(HgDisposable.getInstance(myProject), () -> executeInCurrentThread(files));
    }
  }
public void addWithProgress(final Collection<? extends VirtualFile> files)