diff lisp/vc.el @ 109252:64f9d1b2b73b

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)
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 21 Jun 2010 18:26:30 -0700
parents e542aa3511d0
children 0c54c271bb98
line wrap: on
line diff
--- a/lisp/vc.el	Mon Jun 21 13:03:30 2010 -0700
+++ b/lisp/vc.el	Mon Jun 21 18:26:30 2010 -0700
@@ -1655,8 +1655,9 @@
 		    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 @@
 		      ;; 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))))