master 4470996198d: * lisp/vc/vc-hg.el (vc-hg-previous-revision): Use 'hg log'.
Sean Whitton <[email protected]>
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: master commit 4470996198d1cad003c174aee478c65cb439a7af Author: Sean Whitton <[email protected]> Commit: Sean Whitton <[email protected]> * lisp/vc/vc-hg.el (vc-hg-previous-revision): Use 'hg log'. 'hg id' is much slower than 'hg log'. --- lisp/vc/vc-hg.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 7a073d0b20b..0fa22d97fad 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1158,11 +1158,11 @@ hg binary." (t ;; We can't simply decrement by 1, because that revision might ;; be e.g. on a different branch (bug#22032). - (with-temp-buffer - (and (zerop (vc-hg-command t nil nil "id" "-n" - "-r" (concat rev "~1"))) - ;; Trim the trailing newline. - (buffer-substring (point-min) (1- (point-max)))))))) + (with-output-to-string + (vc-hg-command standard-output 0 nil "log" + "-r" (format "revset(%s~1)" rev) + "--template" (if vc-use-short-revision + "{node|short}" "{node}")))))) (defun vc-hg-next-revision (_file rev) (let ((newrev (1+ (string-to-number rev)))