void (@NotNull AnActionEvent event) { final DataContext dataContext = event.getDataContext(); final Project project = CommonDataKeys.PROJECT.getData(dataContext); final VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext); if (project == null || files == null || files.length == 0) { return; } project.save(); final HgVcs vcs = HgVcs.getInstance(project); if ((vcs == null) || !ProjectLevelVcsManager.getInstance(project).checkAllFilesAreUnder(vcs, files)) { return; } final AbstractVcsHelper helper = AbstractVcsHelper.getInstance(project); List<VcsException> exceptions = helper.runTransactionRunnable(vcs, new TransactionRunnable() { @Override public void run(List<VcsException> exceptions) { try { execute(project, vcs, files, dataContext); } catch (VcsException ex) { exceptions.add(ex); } } }, null); helper.showErrors(exceptions, vcs.getDisplayName()); }