@NotNull
  public static HgRevisionNumber getBranchRevisionNumber(@NotNull HgRepository repository,
                                                         @NotNull String branchName) throws VcsException {
    Hash refHashToCompare = detectActiveHashByName(repository, branchName);
    if (refHashToCompare == null) {
      throw new VcsException(HgBundle.message("action.hg4idea.CompareWithBranch.cannot.detect.commit", branchName, repository.getRoot()));
    }
    return HgRevisionNumber.getInstance(branchName, refHashToCompare.toString());
  }
@NotNull
  public static HgRevisionNumber getBranchRevisionNumber(@NotNull HgRepository repository,
                                                         @NotNull String branchName)