diff options
author | John Wiegley <johnw@newartisans.com> | 2015-12-29 21:39:08 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2015-12-29 21:39:08 -0800 |
commit | ec0a80cc283badc7f7fd5ef78512dde6d34b1355 (patch) | |
tree | 7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /lisp/vc/vc-hg.el | |
parent | d259328fb87db8cc67d52771efcfa653e52c5b71 (diff) | |
parent | e823c34072bf045800d91e12c7ddb61fa23c6e30 (diff) | |
download | emacs-25-merge.tar.gz |
Merge emacs-25 into master (using imerge)emacs-25-merge
Diffstat (limited to 'lisp/vc/vc-hg.el')
-rw-r--r-- | lisp/vc/vc-hg.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 92b0c3169c1..62fbfde5f87 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -335,7 +335,7 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") -(defun vc-hg-diff (files &optional oldvers newvers buffer async) +(defun vc-hg-diff (files &optional oldvers newvers buffer _async) "Get a difference report using hg between two revisions of FILES." (let* ((firstfile (car files)) (working (and firstfile (vc-working-revision firstfile)))) @@ -345,8 +345,8 @@ If LIMIT is non-nil, show no more than this many entries." (setq oldvers working)) (apply #'vc-hg-command (or buffer "*vc-diff*") - (if async 'async nil) - files "diff" + nil ; bug#21969 + files "diff" (append (vc-switches 'hg 'diff) (when oldvers @@ -430,9 +430,13 @@ Optional arg REVISION is a revision to annotate from." ;;; Miscellaneous (defun vc-hg-previous-revision (_file rev) - (let ((newrev (1- (string-to-number rev)))) - (when (>= newrev 0) - (number-to-string newrev)))) + ;; We can't simply decrement by 1, because that revision might be + ;; e.g. on a different branch (bug#22032). + (with-temp-buffer + (and (eq 0 + (vc-hg-command t nil nil "id" "-n" "-r" (concat rev "^"))) + ;; Trim the trailing newline. + (buffer-substring (point-min) (1- (point-max)))))) (defun vc-hg-next-revision (_file rev) (let ((newrev (1+ (string-to-number rev))) |