public static @Nls @NotNull String getDisplayableBranchOrBookmarkText(@NotNull HgRepository repository) {
    HgRepository.State state = repository.getState();

    String branchName = StringUtil.notNullize(repository.getCurrentBranchName());

    if (state == HgRepository.State.MERGING) {
      return HgBundle.message("hg4idea.status.bar.widget.text.merge", branchName);
    }
    else if (state == HgRepository.State.REBASING) {
      return HgBundle.message("hg4idea.status.bar.widget.text.rebase", branchName);
    }
    else if (state == HgRepository.State.GRAFTING) {
      return HgBundle.message("hg4idea.status.bar.widget.text.graft", branchName);
    }
    else {
      return branchName;
    }
  }
public static @Nls @NotNull String getDisplayableBranchOrBookmarkText(@NotNull HgRepository repository)