Commit 04ec0963 authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

Fix finding revisions in for renamed files in vc-annotate.

* lisp/vc.el (vc-find-revision): Add an optional argument for
the VC backend.  Use it when non-nil.
* lisp/vc-annotate.el (vc-annotate-find-revision-at-line): Pass the VC
backend to vc-find-revision.  (Bug#6487)
parent c036381c
2010-06-21 Dan Nicolaescu <dann@ics.uci.edu>
Fix finding revisions in for renamed files in vc-annotate.
* vc.el (vc-find-revision): Add an optional argument for
the VC backend. Use it when non-nil.
* vc-annotate.el (vc-annotate-find-revision-at-line): Pass the VC
backend to vc-find-revision. (Bug#6487)
2010-06-21 Dan Nicolaescu <dann@ics.uci.edu>
Fix reading file names in Git annotate buffers.
......
......@@ -461,7 +461,7 @@ Return a cons (REV . FILENAME)."
(if (not rev-at-line)
(message "Cannot extract revision number from the current line")
(switch-to-buffer-other-window
(vc-find-revision (cdr rev-at-line) (car rev-at-line)))))))
(vc-find-revision (cdr rev-at-line) (car rev-at-line) vc-annotate-backend))))))
(defun vc-annotate-revision-previous-to-line ()
"Visit the annotation of the revision before the revision at line."
......
......@@ -1655,8 +1655,9 @@ If `F.~REV~' already exists, use it instead of checking it out again."
rev)))
(switch-to-buffer-other-window (vc-find-revision file revision))))
(defun vc-find-revision (file revision)
"Read REVISION of FILE into a buffer and return the buffer."
(defun vc-find-revision (file revision &optional backend)
"Read REVISION of FILE into a buffer and return the buffer.
Use BACKEND as the VC backend if specified."
(let ((automatic-backup (vc-version-backup-file-name file revision))
(filebuf (or (get-file-buffer file) (current-buffer)))
(filename (vc-version-backup-file-name file revision 'manual)))
......@@ -1674,7 +1675,9 @@ If `F.~REV~' already exists, use it instead of checking it out again."
;; Change buffer to get local value of
;; vc-checkout-switches.
(with-current-buffer filebuf
(vc-call find-revision file revision outbuf))))
(if backend
(vc-call-backend backend 'find-revision file revision outbuf)
(vc-call find-revision file revision outbuf)))))
(setq failed nil))
(when (and failed (file-exists-p filename))
(delete-file filename))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment