From cca0f933594a22a834ffae5475488a6066c584c1 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 10 Jan 2016 04:38:34 +0300 Subject: [PATCH] ; Account for spaces before the filename --- lisp/vc/vc-hg.el | 4 ++-- test/automated/vc-hg.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 85e23769db8..8cb3547b13b 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -397,7 +397,7 @@ Optional arg REVISION is a revision to annotate from." (concat "^\\(?: *[^ ]+ +\\)?\\([0-9]+\\) " ;User and revision. "\\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\\)" ;Date. - "\\( [^:]+\\)?:")) ;Filename, + "\\(?: +\\([^:]+\\)\\)?:")) ;Filename. (defun vc-hg-annotate-time () (when (looking-at vc-hg-annotate-re) @@ -415,7 +415,7 @@ Optional arg REVISION is a revision to annotate from." (when (looking-at vc-hg-annotate-re) (if (match-beginning 3) (cons (match-string-no-properties 1) - (expand-file-name (substring (match-string-no-properties 3) 1) + (expand-file-name (match-string-no-properties 3) (vc-hg-root default-directory))) (match-string-no-properties 1))))) diff --git a/test/automated/vc-hg.el b/test/automated/vc-hg.el index 6a746ce5890..68282713a8a 100644 --- a/test/automated/vc-hg.el +++ b/test/automated/vc-hg.el @@ -45,7 +45,7 @@ (ert-deftest vc-hg-annotate-extract-revision-at-line-with-both () (with-temp-buffer - (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:")) + (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:")) (should (equal (vc-hg-annotate-extract-revision-at-line) (cons "218075" -- 2.39.5