String (@NotNull Collection<HgRepository> repositories) { String currentBranch; if (repositories.size() > 1) { HgMultiRootBranchConfig multiRootBranchConfig = new HgMultiRootBranchConfig(repositories); currentBranch = multiRootBranchConfig.getCurrentBranch(); } else { assert !repositories.isEmpty() : "No repositories passed to HgBranchOperationsProcessor."; HgRepository repository = repositories.iterator().next(); currentBranch = repository.getCurrentBranchName(); } return currentBranch == null ? CURRENT_REVISION : currentBranch; }