private void updateToPulledHead( VirtualFile repo, UpdatedFiles updatedFiles, HgRevisionNumber newHead, ProgressIndicator indicator) { indicator.setText2(HgVcsMessages.message("hg4idea.update.progress.updating.to.pulled.head")); HgRevisionNumber parentBeforeUpdate = new HgWorkingCopyRevisionsCommand(project).firstParent(repo); HgUpdateCommand updateCommand = new HgUpdateCommand(project, repoRoot); updateCommand.setRevision(newHead.getChangeset()); updateCommand.setClean(true); updateCommand.execute(); HgRevisionNumber commonParent = findCommonParent(newHead, parentBeforeUpdate); addUpdatedFiles(repo, updatedFiles, commonParent, newHead); }
private void update( @NotNull VirtualFile repo, ProgressIndicator indicator, UpdatedFiles updatedFiles, List<VcsException> warnings) throws VcsException { indicator.setText2(HgVcsMessages.message("hg4idea.progress.updatingworkingdir")); HgRevisionNumber parentBeforeUpdate = new HgWorkingCopyRevisionsCommand(project).firstParent(repo); HgUpdateCommand hgUpdateCommand = new HgUpdateCommand(project, repo); String warningMessages = ensureSuccess(hgUpdateCommand.execute()).getWarnings(); handlePossibleWarning(warnings, warningMessages); HgRevisionNumber parentAfterUpdate = new HgWorkingCopyRevisionsCommand(project).firstParent(repo); addUpdatedFiles(repo, updatedFiles, parentBeforeUpdate, parentAfterUpdate); }