void (@NotNull AnActionEvent e) { final Project project = e.getProject(); boolean showUpdateOptions = isShowOptions(project); LOG.debug("project: " + project + ", show update options: " + showUpdateOptions); if (project == null) { return; } try { FilePath[] roots = getRoots(project, e.getDataContext()); if (roots.length == 0) { LOG.debug("No roots found."); return; } final Map<AbstractVcs, Collection<FilePath>> vcsToVirtualFiles = createVcsToFilesMap(roots, project); for (AbstractVcs vcs : vcsToVirtualFiles.keySet()) { final UpdateEnvironment updateEnvironment = myActionInfo.getEnvironment(vcs); if ((updateEnvironment != null) && (!updateEnvironment.validateOptions(vcsToVirtualFiles.get(vcs)))) { // messages already shown LOG.debug("Options not valid for files: " + vcsToVirtualFiles); return; } } if (showUpdateOptions || OptionsDialog.shiftIsPressed(e.getModifiers())) { String scopeName = myScopeInfo.getScopeName(e.getDataContext(), myActionInfo); showOptionsDialog(vcsToVirtualFiles, project, scopeName); } if (ApplicationManager.getApplication().isDispatchThread()) { // Not only documents, but also project settings should be saved, // to ensure that if as a result of Update some project settings will be changed, // all local changes are saved in prior and do not overwrite remote changes. // Also, there is a chance that save during update can break it - // we do disable auto saving during update, but still, there is a chance that save will occur. FileDocumentManager.getInstance().saveAllDocuments(); forPoorJavaClientOnlySaveProjectIndEdtDoNotUseThisMethod(project, false); } Task.Backgroundable task = new Updater(project, roots, vcsToVirtualFiles, myActionInfo, getTemplatePresentation().getText()) { @Override public void onSuccess() { super.onSuccess(); AbstractCommonUpdateAction.this.onSuccess(); } }; if (ApplicationManager.getApplication().isUnitTestMode()) { task.run(new EmptyProgressIndicator()); } else { ProgressManager.getInstance().run(task); } } catch (ProcessCanceledException ignored) { } }