]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix finding revisions in for renamed files in vc-annotate.
authorDan Nicolaescu <dann@ics.uci.edu>
Tue, 22 Jun 2010 01:26:30 +0000 (18:26 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Tue, 22 Jun 2010 01:26:30 +0000 (18:26 -0700)
* 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)

lisp/ChangeLog
lisp/vc-annotate.el
lisp/vc.el

index 9cb50c3e98aefe99527ac75875cef0533bd648f0..7474fcf866fd3ba83d4a00d18df03c8d7b3bb5b4 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 437081293cbaabde092060eb1ae60cca4456250c..c372cb9922e9c636a9cfdb1e8c526e72888a13e0 100644 (file)
@@ -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."
index e29603fcc1cdef43aa518192a2e23ffcce8defab..194c2a0898351be0ec234e3a5d50378beb5253c1 100644 (file)
@@ -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))))