Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#618: 23.0.60; Bazaar support: no revision number with lightweight checkouts

0 views
Skip to first unread message

Chong Yidong

unread,
Jan 1, 2010, 5:43:29 PM1/1/10
to Torsten Bronger, 6...@debbugs.gnu.org
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?


Dan Nicolaescu

unread,
Jan 2, 2010, 2:00:29 AM1/2/10
to Chong Yidong, 6...@debbugs.gnu.org
Chong Yidong <c...@stupidchicken.com> writes:

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))))


Chong Yidong

unread,
Jan 2, 2010, 4:21:26 PM1/2/10
to Dan Nicolaescu, 6...@debbugs.gnu.org
Dan Nicolaescu <da...@ics.uci.edu> writes:

> 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.

The patch looks good; if your testing shows that it works, please go
ahead and check it in (and close this bug). Thanks.


Torsten Bronger

unread,
Jan 5, 2010, 4:03:28 AM1/5/10
to Chong Yidong, 6...@debbugs.gnu.org
Hallöchen!

Chong Yidong 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).

If I remember correctly, someone fixed this shortly after my report.
However, we "agreed" on a rather poor solution: Falling back to
calling "bzr revno" for every open file. I've used this solution
for many months now. It slows down Emacs' startup time
significantly. After all, bzr being a Python program, causes a lot
of overhead.

Therefore, on the long run, Emacs should use the file system even
for lightweight checkouts. (As long as the branch is local of
course. But this is typical usage lightweight checkouts.)

Tschö,
Torsten.

--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten...@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com


Dan Nicolaescu

unread,
Jan 5, 2010, 4:22:35 PM1/5/10
to Torsten Bronger, 6...@debbugs.gnu.org
Torsten Bronger <bro...@physik.rwth-aachen.de> writes:

> Hallöchen!
>
> Chong Yidong 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).
>
> If I remember correctly, someone fixed this shortly after my report.
> However, we "agreed" on a rather poor solution: Falling back to
> calling "bzr revno" for every open file. I've used this solution
> for many months now. It slows down Emacs' startup time
> significantly. After all, bzr being a Python program, causes a lot
> of overhead.
>
> Therefore, on the long run, Emacs should use the file system even
> for lightweight checkouts. (As long as the branch is local of
> course. But this is typical usage lightweight checkouts.)

I checked in a fix, bzr should not be run anymore for lightweight checkouts.


Torsten Bronger

unread,
Jan 5, 2010, 5:38:46 PM1/5/10
to Dan Nicolaescu, 6...@debbugs.gnu.org
Hallöchen!

Dan Nicolaescu writes:

> [...]


>
> I checked in a fix, bzr should not be run anymore for lightweight
> checkouts.

Indeed, I can confirm this. Thank you!

0 new messages