diff lisp/vc-git.el @ 105670:6f463ea7a91a

Make vc-annotate work through copies and renames. * vc-annotate.el (vc-annotate-extract-revision-at-line): Return the file name too. (vc-annotate-revision-at-line) (vc-annotate-find-revision-at-line) (vc-annotate-revision-previous-to-line) (vc-annotate-show-log-revision-at-line): Update to get the file name from vc-annotate-extract-revision-at-line. (vc-annotate-show-diff-revision-at-line-internal): Change the argument to mean whether to show a file diff or not. Get the file name from vc-annotate-extract-revision-at-line. (vc-annotate-show-diff-revision-at-line): Update vc-annotate-show-diff-revision-at-line call. (vc-annotate-warp-revision): Add an optional file argument. * vc-git.el (vc-git-annotate-command): Pass -C -C to the blame command. (vc-git-annotate-extract-revision-at-line): Also return the file name if found. * vc-hg.el (vc-hg-annotate-command): Pass --follow to the annotate command. Remove unused code. (vc-hg-annotate-re): Update to match --follow output. (vc-hg-annotate-extract-revision-at-line): Also return the file name if found. * vc.el: Update annotate-extract-revision-at-line documentation.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 19 Oct 2009 05:04:22 +0000
parents 1987d1800365
children 78f37cce705f
line wrap: on
line diff
--- a/lisp/vc-git.el	Mon Oct 19 04:27:09 2009 +0000
+++ b/lisp/vc-git.el	Mon Oct 19 05:04:22 2009 +0000
@@ -610,7 +610,7 @@
 
 (defun vc-git-annotate-command (file buf &optional rev)
   (let ((name (file-relative-name file)))
-    (vc-git-command buf 'async name "blame" "--date=iso" rev "--")))
+    (vc-git-command buf 'async name "blame" "--date=iso" "-C" "-C" rev)))
 
 (declare-function vc-annotate-convert-time "vc-annotate" (time))
 
@@ -624,8 +624,11 @@
 (defun vc-git-annotate-extract-revision-at-line ()
   (save-excursion
     (move-beginning-of-line 1)
-    (and (looking-at "[0-9a-f^][0-9a-f]+")
-         (buffer-substring-no-properties (match-beginning 0) (match-end 0)))))
+    (when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?")
+      (let ((revision (match-string-no-properties 1)))
+	(if (match-beginning 2)
+	  (cons revision (expand-file-name (match-string-no-properties 3)))
+	  revision)))))
 
 ;;; TAG SYSTEM