void (@NotNull VcsRef reference, boolean favorite) { if (!reference.getType().isBranch() || reference.getType().equals(HEAD) || reference.getType().equals(TIP)) return; myProject.getService(HgBranchManager.class) .setFavorite(getBranchType(reference), getRepository(reference), reference.getName(), favorite); }