[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#618: 23.0.60; Bazaar support: no revision number with lightweight ch
From: |
Dan Nicolaescu |
Subject: |
bug#618: 23.0.60; Bazaar support: no revision number with lightweight checkouts |
Date: |
Fri, 1 Jan 2010 23:00:29 -0800 (PST) |
Chong Yidong <cyd@stupidchicken.com> writes:
> Hi Torsten,
>
> > In Bazaar lightweight checkouts, Emacs doesn't show the revision
> > number in the mode line.
>
> I think this depends on the branch format, whose default has changed
> since this bug was first reported. For the latest version of bzr, Emacs
> shows the revision number in the mode line for lightweight checkouts (at
> least for me). Do you still experience this problem?
The version number gets displayed correctly, but all files are shown as
modified.
I looked at this some time ago, and the patch below seems to do the
right thing for edited/up-to-date.
Index: vc-bzr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-bzr.el,v
retrieving revision 1.94
diff -u -3 -p -a -r1.94 vc-bzr.el
--- vc-bzr.el 9 Dec 2009 06:04:12 -0000 1.94
+++ vc-bzr.el 2 Jan 2010 06:45:17 -0000
@@ -176,13 +176,13 @@ Invoke the bzr command adding `BZR_PROGR
"\0"
"[^\0]*\0" ;id?
"\\([^\0]*\\)\0" ;"a/f/d", a=removed?
- "[^\0]*\0" ;sha1 (empty if conflicted)?
- "\\([^\0]*\\)\0" ;size?
+ "\\([^\0]*\\)\0" ;sha1 (empty if conflicted)?
+ "\\([^\0]*\\)\0" ;size?p
"[^\0]*\0" ;"y/n", executable?
"[^\0]*\0" ;?
"\\([^\0]*\\)\0" ;"a/f/d" a=added?
"\\([^\0]*\\)\0" ;sha1 again?
- "[^\0]*\0" ;size again?
+ "\\([^\0]*\\)\0" ;size again?
"[^\0]*\0" ;"y/n", executable again?
"[^\0]*\0" ;last revid?
;; There are more fields when merges are
pending.
@@ -194,11 +194,20 @@ Invoke the bzr command adding `BZR_PROGR
;; conflict markers).
(cond
((eq (char-after (match-beginning 1)) ?a) 'removed)
- ((eq (char-after (match-beginning 3)) ?a) 'added)
- ((and (eq (string-to-number (match-string 2))
+ ((eq (char-after (match-beginning 4)) ?a) 'added)
+ ((or (and (eq (string-to-number (match-string 3))
(nth 7 (file-attributes file)))
- (equal (match-string 4)
+ (equal (match-string 5)
(vc-bzr-sha1 file)))
+ (and
+ ;; It looks like for lightweight
+ ;; checkouts \2 is empty and we need to
+ ;; look for size in \6.
+ (eq (match-beginning 2) (match-end 2))
+ (eq (string-to-number (match-string 6))
+ (nth 7 (file-attributes file)))
+ (equal (match-string 5)
+ (vc-bzr-sha1 file))))
'up-to-date)
(t 'edited))
'unregistered))))