public HgCommandExitCode executeInCurrentThread() {
    List<String> arguments = new LinkedList<>();
    if (update) {
      arguments.add("--update");
    } else if (rebase) {
      arguments.add("--rebase");
    }

    if (!StringUtil.isEmptyOrSpaces(revision)) {
      arguments.add("--rev");
      arguments.add(revision);
    }

    arguments.add(source);

    final HgRemoteCommandExecutor executor = new HgRemoteCommandExecutor(project, source);
    executor.setShowOutput(true);
    HgCommandResult result = executor.executeInCurrentThread(repo, "pull", arguments);
    if (HgErrorUtil.isAuthorizationError(result)) {
      new HgCommandResultNotifier(project)
        .notifyError(PULL_AUTH_REQUIRED,
                     result,
                     HgBundle.message("action.hg4idea.pull.auth.required"),
                     HgBundle.message("action.hg4idea.pull.auth.required.msg", source));
      return ERROR;
    }
    else if (HgErrorUtil.isAbort(result) || result.getExitValue() > 1) { //if result == null - > isAbort returns true
      new HgCommandResultNotifier(project)
        .notifyError(PULL_ERROR, result, "", HgBundle.message("action.hg4idea.pull.failed"));
      return ERROR;
    }
    else if (result.getExitValue() == 1) {
      return UNRESOLVED;
    }
    else {
      BackgroundTaskUtil.syncPublisher(project, HgVcs.REMOTE_TOPIC).update(project, null);
      return SUCCESS;
    }
  }
public HgCommandExitCode executeInCurrentThread()