private void processRebase(ProgressIndicator indicator, final UpdatedFiles updatedFiles) throws VcsException {
    indicator.setText2(HgBundle.message("hg4idea.progress.rebase"));
    HgRepository repository = HgUtil.getRepositoryManager(project).getRepositoryForRoot(repoRoot);
    if (repository == null) {
      throw new VcsException(HgBundle.message("error.cannot.find.repository.for.file", repoRoot.getPresentableUrl()));
    }
    HgRebaseCommand rebaseCommand = new HgRebaseCommand(project, repository);
    HgCommandResult result = new HgRebaseCommand(project, repository).startRebase();
    if (HgErrorUtil.isCommandExecutionFailed(result)) {
      new HgCommandResultNotifier(project).notifyError(REBASE_ERROR,
                                                       result,
                                                       HgBundle.message("hg4idea.hg.error"),
                                                       HgBundle.message("action.hg4idea.Rebase.error"));
      return;
    }
    //noinspection ConstantConditions
    while (result.getExitValue() == 1) {    //if result == null isAbort will be true;
      resolvePossibleConflicts(updatedFiles);
      if (HgConflictResolver.hasConflicts(project, repoRoot) || HgErrorUtil.isNothingToRebase(result)) {
        break;
      }
      result = rebaseCommand.continueRebase();
      if (HgErrorUtil.isAbort(result)) {
        new HgCommandResultNotifier(project).notifyError(REBASE_CONTINUE_ERROR,
                                                         result,
                                                         HgBundle.message("hg4idea.hg.error"),
                                                         HgBundle.message("action.hg4idea.Rebase.Continue.error"));
        break;
      }
    }
    repository.update();
    repoRoot.refresh(true, true);
  }
private void processRebase(ProgressIndicator indicator, final UpdatedFiles updatedFiles)