changeset 106461:26c68e7906a5

* vc-bzr.el (vc-bzr-annotate-command): Show author in annotation. Handle empty author field (Bug#4144). Suggested by scar Fuentes. (vc-bzr-annotate-time, vc-bzr-annotate-extract-revision-at-line): Update annotation regexp.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 06 Dec 2009 20:22:16 +0000
parents e341c53bc4af
children 3affeccb7b33
files lisp/ChangeLog lisp/vc-bzr.el
diffstat 2 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Dec 06 19:49:04 2009 +0000
+++ b/lisp/ChangeLog	Sun Dec 06 20:22:16 2009 +0000
@@ -10,6 +10,11 @@
 
 2009-12-06  Chong Yidong  <cyd@stupidchicken.com>
 
+	* vc-bzr.el (vc-bzr-annotate-command): Show author in annotation.
+	Handle empty author field (Bug#4144).  Suggested by Óscar Fuentes.
+	(vc-bzr-annotate-time, vc-bzr-annotate-extract-revision-at-line):
+	Update annotation regexp.
+
 	* simple.el (beginning-of-visual-line): Constrain to field
 	boundaries (Bug#5106).
 
--- a/lisp/vc-bzr.el	Sun Dec 06 19:49:04 2009 +0000
+++ b/lisp/vc-bzr.el	Sun Dec 06 20:22:16 2009 +0000
@@ -571,10 +571,14 @@
                     (tag (gethash key table))
                     (inhibit-read-only t))
                (setq string (substring string (match-end 0)))
-        (unless tag
-          (setq tag (propertize rev 'help-echo (concat "Author: " author
-                                                       ", date: " date)
-                                'mouse-face 'highlight))
+	       (unless tag
+		 (setq tag
+		       (propertize
+			(concat rev " " (substring author 0 7))
+			'help-echo (format "Revision: %d, author: %s, date: %s"
+					   (string-to-number rev)
+					   author date)
+			'mouse-face 'highlight))
                  (puthash key tag table))
                (goto-char (process-mark proc))
                (insert tag line)
@@ -584,7 +588,7 @@
 (declare-function vc-annotate-convert-time "vc-annotate" (time))
 
 (defun vc-bzr-annotate-time ()
-  (when (re-search-forward "^ *[0-9.]+ +|" nil t)
+  (when (re-search-forward "^ *[0-9.]+ +[^\n ]* +|" nil t)
     (let ((prop (get-text-property (line-beginning-position) 'help-echo)))
       (string-match "[0-9]+\\'" prop)
       (let ((str (match-string-no-properties 0 prop)))
@@ -599,7 +603,7 @@
 Return nil if current line isn't annotated."
   (save-excursion
     (beginning-of-line)
-    (if (looking-at " *\\([0-9.]+\\) *| ")
+    (if (looking-at "^ *\\([0-9.]+\\) +[^\n ]* +|")
         (match-string-no-properties 1))))
 
 (defun vc-bzr-command-discarding-stderr (command &rest args)