diff options
author | Miles Bader <miles@gnu.org> | 2008-05-18 22:43:24 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2008-05-18 22:43:24 +0000 |
commit | 4787a496a05fdc03241850b45911dd283d4b06b8 (patch) | |
tree | b10e73b3e2792e1070070626bb3863deba9ec6a7 /lisp/vc-hg.el | |
parent | 03c673c9f4e65bacf224c3010c4c36997fb0a9f0 (diff) | |
parent | 4064ff25b6d02f0b1d4c511352c5e94533e0adbe (diff) | |
download | emacs-4787a496a05fdc03241850b45911dd283d4b06b8.tar.gz |
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1169
Diffstat (limited to 'lisp/vc-hg.el')
-rw-r--r-- | lisp/vc-hg.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 6b025c8cfa7..eb392291653 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el @@ -288,14 +288,18 @@ Optional arg REVISION is a revision to annotate from." (when revision (concat "-r" revision))) (with-current-buffer buffer (goto-char (point-min)) - (re-search-forward "^[0-9]") - (delete-region (point-min) (1- (point))))) + (re-search-forward "^[ \t]*[0-9]") + (delete-region (point-min) (match-beginning 0)))) ;; 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) @@ -306,7 +310,7 @@ Optional arg REVISION is a revision 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-revision (file rev) (let ((newrev (1- (string-to-number rev)))) |