void (final @NotNull Project project) { final LocalChangeList activeChangeList = ChangeListManager.getInstance(project).getDefaultChangeList(); HgVcs vcs = HgVcs.getInstance(project); assert vcs != null; final HgRepositoryManager repositoryManager = HgUtil.getRepositoryManager(project); List<Change> changesForRepositories = ContainerUtil.filter(activeChangeList.getChanges(), change -> myRepositories.contains(repositoryManager.getRepositoryForFile( ChangesUtil.getFilePath(change)))); Set<AbstractVcs> affectedVcses = Collections.singleton(vcs); List<HgCloseBranchExecutor> executors = Collections.singletonList(new HgCloseBranchExecutor(myRepositories)); String commitMessage = "Close Branch"; //NON-NLS CommitChangeListDialog.showCommitDialog(project, affectedVcses, changesForRepositories, activeChangeList, executors, false, commitMessage, null); }