From 37860cafd5acdc2348675f2e9bc1a0934a55f30d Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 5 Jan 2010 13:19:34 -0800 Subject: [PATCH] (vc-bzr-working-revision): Fix looking for a revision in a lightweight checkout. --- lisp/ChangeLog | 5 +++++ lisp/vc-bzr.el | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b493440367..2dc2a1270bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-05 Dan Nicolaescu + + * vc-bzr.el (vc-bzr-working-revision): Fix looking for a revision + in a lightweight checkout. + 2010-01-05 Kenichi Handa * language/indian.el (malayalam-composable-pattern): Fix ZWNJ and diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index fc62696af1d..d0b8ec8ff6a 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -356,9 +356,19 @@ If any error occurred in running `bzr status', then return nil." (if (file-exists-p location-fname) (with-temp-buffer (insert-file-contents location-fname) - (when (re-search-forward "file://\(.+\)" nil t) - (setq branch-format-file (match-string 1)) - (file-exists-p branch-format-file))) + ;; If the lightweight checkout points to a + ;; location in the local file system, then we can + ;; look there for the version information. + (when (re-search-forward "file://\\(.+\\)" nil t) + (let ((l-c-parent-dir (match-string 1))) + (setq branch-format-file + (expand-file-name vc-bzr-admin-branch-format-file + l-c-parent-dir)) + (setq lastrev-file + (expand-file-name vc-bzr-admin-lastrev l-c-parent-dir)) + ;; FIXME: maybe it's overkill to check if both these files exist. + (and (file-exists-p branch-format-file) + (file-exists-p lastrev-file))))) t))) (with-temp-buffer (insert-file-contents branch-format-file) -- 2.39.2