void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @Nullable final String reference) { final HgTagDialog dialog = new HgTagDialog(project, repositories, selectedRepo); if (dialog.showAndGet()) { try { new HgTagCreateCommand(project, dialog.getRepository(), dialog.getTagName(), reference).executeAsynchronously(new HgCommandResultHandler() { @Override public void process(@Nullable HgCommandResult result) { if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(project) .notifyError(TAG_CREATION_ERROR, result, HgBundle.message("hg4idea.branch.creation.error"), HgBundle.message("action.hg4idea.CreateTag.error.msg", dialog.getTagName())); } } }); } catch (HgCommandException e) { HgErrorUtil.handleException(project, TAG_CREATION_FAILED, e); } } }