Subject: Re: bug#14216: 24.2; vc-annotate for hg mistreats lines with ": " as partially bmeing part of the revision specification (with patch)

From: Stefan Monnier <[email-masked]>
Date: Tue, 16 Apr 2013 20:51:42 -0400

> It long irked me that when I run vc-annotate in a Mercurial
> repository, some lines get treated as part of the revision
> spec. Example:
> # try this: <- that is part of the revision specification

I installed the patch below which should still allow colon in names,
except when followed by a space.

        Stefan

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2013-04-17 00:35:22 +0000
+++ lisp/ChangeLog	2013-04-17 00:49:44 +0000
@@ -1,3 +1,8 @@
+2013-04-17  Stefan Monnier  <[email-masked]>
+
+	* vc/vc-hg.el (vc-hg-annotate-re): Disallow ": " in file names
+	(bug#14216).
+
 2013-04-17  Jean-Philippe Gravel  <[email-masked]>
 
 	* progmodes/gdb-mi.el (gdbmi-bnf-incomplete-record-result):

=== modified file 'lisp/vc/vc-hg.el'
--- lisp/vc/vc-hg.el	2013-02-01 17:19:24 +0000
+++ lisp/vc/vc-hg.el	2013-04-17 00:44:50 +0000
@@ -357,7 +357,7 @@
 ;;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\\}\\)\\(?:\\(: \\)\\|\\(?: +\\(.+\\): \\)\\)")
+  "^[ \t]*\\([0-9]+\\) \\(.\\{30\\}\\)\\(?:\\(: \\)\\|\\(?: +\\([^:\n]+\\(?::\\(?:[^: \n][^:\n]*\\)?\\)*\\): \\)\\)")
 
 (defun vc-hg-annotate-time ()
   (when (looking-at vc-hg-annotate-re)