HgCommonBranchActions (List<HgRepository> allRepositories, String name, boolean isBookmark) { List<HgRepository> repositories = filterRepositoriesNotOnThisBranch(name, allRepositories); if (repositories.isEmpty()) return null; return isBookmark ? new HgBranchPopupActions.BookmarkActions(myProject, repositories, name) : new HgBranchPopupActions.BranchActions(myProject, repositories, name); }