]> code.delx.au - gnu-emacs/commitdiff
(vc-hg-annotate-re): Recognize the output of --follow.
authorDan Nicolaescu <dann@ics.uci.edu>
Sun, 18 May 2008 07:22:25 +0000 (07:22 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Sun, 18 May 2008 07:22:25 +0000 (07:22 +0000)
lisp/ChangeLog
lisp/vc-hg.el

index 927983e12cc327ab844f2779cefdc1daf1a2203f..09ff5bec16cfc236a94e758bdae9d938555b9403 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-18  David Hull <david@snap.com>  (tiny change)
+
+       * vc-hg.el (vc-hg-annotate-re): Recognize the output of --follow.
+
 2008-05-18  mohrmarc  <debian@miller-mohr.de>  (tiny change)
 
        * progmodes/fortran.el (fortran-font-lock-keywords-2): Add keywords for
index 7bd54528a6e926581349228f3cf62938104c54b5..3233b77bb44e6786eb4374cf30a2b67e710212d6 100644 (file)
@@ -318,7 +318,11 @@ Optional arg VERSION is a version to annotate from."
 ;; The format for one line output by "hg annotate -d -n" looks like this:
 ;;215 Wed Jun 20 21:22:58 2007 -0700: CONTENTS
 ;; i.e: VERSION_NUMBER DATE: CONTENTS
-(defconst vc-hg-annotate-re "^[ \t]*\\([0-9]+\\) \\(.\\{30\\}\\): ")
+;; If the user has set the "--follow" option, the output looks like:
+;;215 Wed Jun 20 21:22:58 2007 -0700 foo.c: CONTENTS
+;; i.e. VERSION_NUMBER DATE FILENAME: CONTENTS
+(defconst vc-hg-annotate-re
+  "^[ \t]*\\([0-9]+\\) \\(.\\{30\\}\\)[^:\n]*\\(:[^ \n][^:\n]*\\)*: ")
 
 (defun vc-hg-annotate-time ()
   (when (looking-at vc-hg-annotate-re)
@@ -329,7 +333,7 @@ Optional arg VERSION is a version to annotate from."
 (defun vc-hg-annotate-extract-revision-at-line ()
   (save-excursion
     (beginning-of-line)
-    (if (looking-at vc-hg-annotate-re) (match-string-no-properties 1))))
+    (when (looking-at vc-hg-annotate-re) (match-string-no-properties 1))))
 
 (defun vc-hg-previous-version (file rev)
   (let ((newrev (1- (string-to-number rev))))