private HgCommandResult doMerge(ProgressIndicator indicator) throws VcsException {
    indicator.setText2(HgBundle.message("hg4idea.update.progress.merging"));
    HgRepository repository = HgUtil.getRepositoryManager(project).getRepositoryForRoot(repoRoot);
    if (repository == null) {
      LOG.error("Couldn't find repository for " + repoRoot.getName());
      return null;
    }
    HgMergeCommand mergeCommand = new HgMergeCommand(project, repository);
    //do not explicitly set the revision, that way mercurial itself checks that there are exactly
    //two heads in this branch
    //    mergeCommand.setRevision(headToMerge.getRevision());
    return mergeCommand.mergeSynchronously();
  }
private HgCommandResult doMerge(ProgressIndicator indicator)