# HG changeset patch # User Dan Nicolaescu # Date 1262579721 28800 # Node ID 82660e679622e16c73e9245b5aec3f29e0250bf4 # Parent d27fa53594867cde1a3c1bdee730d3a6c9bf7c6f (vc-bzr-state-heuristic): Make it work for lightweight checkouts. (Bug#618) diff -r d27fa5359486 -r 82660e679622 lisp/ChangeLog --- a/lisp/ChangeLog Sun Jan 03 20:27:17 2010 +0100 +++ b/lisp/ChangeLog Sun Jan 03 20:35:21 2010 -0800 @@ -1,3 +1,8 @@ +2010-01-04 Dan Nicolaescu + + * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight + checkouts. (Bug#618) + 2010-01-02 Chong Yidong * net/browse-url.el (browse-url-encode-url): Don't escape commas. diff -r d27fa5359486 -r 82660e679622 lisp/vc-bzr.el --- a/lisp/vc-bzr.el Sun Jan 03 20:27:17 2010 +0100 +++ b/lisp/vc-bzr.el Sun Jan 03 20:35:21 2010 -0800 @@ -176,13 +176,13 @@ "\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 @@ ;; 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))))