unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Nicolaescu <dann@ics.uci.edu>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 618@debbugs.gnu.org
Subject: bug#618: 23.0.60; Bazaar support: no revision number with lightweight checkouts
Date: Fri, 1 Jan 2010 23:00:29 -0800 (PST)	[thread overview]
Message-ID: <201001020700.o0270TjM011041@godzilla.ics.uci.edu> (raw)
In-Reply-To: <87k4w178fi.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 01 Jan 2010 17:43:29 -0500")

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






  reply	other threads:[~2010-01-02  7:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-01 22:43 bug#618: 23.0.60; Bazaar support: no revision number with lightweight checkouts Chong Yidong
2010-01-02  7:00 ` Dan Nicolaescu [this message]
2010-01-02 21:21   ` Chong Yidong
2010-01-05  9:03 ` Torsten Bronger
2010-01-05 21:22   ` Dan Nicolaescu
2010-01-05 22:38     ` Torsten Bronger
  -- strict thread matches above, loose matches on Subject: below --
2008-07-27 20:41 Torsten Bronger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001020700.o0270TjM011041@godzilla.ics.uci.edu \
    --to=dann@ics.uci.edu \
    --cc=618@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).