]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-bzr-state-heuristic): Make it work for lightweight
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 4 Jan 2010 04:35:21 +0000 (20:35 -0800)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 4 Jan 2010 04:35:21 +0000 (20:35 -0800)
checkouts.  (Bug#618)

lisp/ChangeLog
lisp/vc-bzr.el

index cfde9093e75025825c1293604d613a00e310f933..82061b6bb65241038d3fd4c7fa1160984dde118b 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-04  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight
+       checkouts.  (Bug#618)
+
 2010-01-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * net/browse-url.el (browse-url-encode-url): Don't escape commas.
index fff4eca57fa42a21652b69f17ee9af673db677dc..80aa420aa9e54292de74830b1a365ebd0cc95d00 100644 (file)
@@ -176,13 +176,13 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' and
                                "\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_PROGRESS_BAR=none' and
                       ;; 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))))