OutgoingResult (@NotNull final HgRepository repository, @NotNull final PushSpec<HgPushSource, HgTarget> pushSpec, boolean initial) { final Project project = repository.getProject(); HgVcs hgvcs = HgVcs.getInstance(project); assert hgvcs != null; final HgVersion version = hgvcs.getVersion(); String[] templates = HgBaseLogParser.constructFullTemplateArgument(true, version); HgOutgoingCommand hgOutgoingCommand = new HgOutgoingCommand(project); HgTarget hgTarget = pushSpec.getTarget(); List<VcsError> errors = new ArrayList<>(); if (StringUtil.isEmptyOrSpaces(hgTarget.myTarget)) { errors.add(new VcsError(HgBundle.message("hg4idea.commit.path.empty.error"))); return new OutgoingResult(Collections.emptyList(), errors); } HgCommandResult result = hgOutgoingCommand .execute(repository.getRoot(), HgChangesetUtil.makeTemplate(templates), pushSpec.getSource().getPresentation(), hgTarget.myTarget, initial); if (result == null) { errors.add(new VcsError(HgBundle.message("hg4idea.commit.cmd.execute.error", repository))); return new OutgoingResult(Collections.emptyList(), errors); } List<String> resultErrors = result.getErrorLines(); if (!resultErrors.isEmpty() && result.getExitValue() != 0) { for (@NlsSafe String error : resultErrors) { if (HgErrorUtil.isAbortLine(error)) { if (HgErrorUtil.isAuthorizationError(error)) { VcsError authorizationError = new VcsError(HgBundle.message("hg4idea.commit.auth.error", error), new VcsErrorHandler() { @Override public void handleError(@NotNull CommitLoader commitLoader) { commitLoader.reloadCommits(); } }); errors.add(authorizationError); } else { errors.add(new VcsError(error)); } } } LOG.warn(resultErrors.toString()); } return new OutgoingResult(HgHistoryUtil.createFullCommitsFromResult(project, repository.getRoot(), result, version, true), errors); }