Mercurial > emacs
comparison lisp/vc-bzr.el @ 106723:82660e679622
(vc-bzr-state-heuristic): Make it work for lightweight
checkouts. (Bug#618)
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sun, 03 Jan 2010 20:35:21 -0800 |
parents | f147ed43b1d5 |
children | 37a9363510b2 |
comparison
equal
deleted
inserted
replaced
106722:d27fa5359486 | 106723:82660e679622 |
---|---|
174 "\0" | 174 "\0" |
175 (regexp-quote (file-name-nondirectory relfile)) | 175 (regexp-quote (file-name-nondirectory relfile)) |
176 "\0" | 176 "\0" |
177 "[^\0]*\0" ;id? | 177 "[^\0]*\0" ;id? |
178 "\\([^\0]*\\)\0" ;"a/f/d", a=removed? | 178 "\\([^\0]*\\)\0" ;"a/f/d", a=removed? |
179 "[^\0]*\0" ;sha1 (empty if conflicted)? | 179 "\\([^\0]*\\)\0" ;sha1 (empty if conflicted)? |
180 "\\([^\0]*\\)\0" ;size? | 180 "\\([^\0]*\\)\0" ;size?p |
181 "[^\0]*\0" ;"y/n", executable? | 181 "[^\0]*\0" ;"y/n", executable? |
182 "[^\0]*\0" ;? | 182 "[^\0]*\0" ;? |
183 "\\([^\0]*\\)\0" ;"a/f/d" a=added? | 183 "\\([^\0]*\\)\0" ;"a/f/d" a=added? |
184 "\\([^\0]*\\)\0" ;sha1 again? | 184 "\\([^\0]*\\)\0" ;sha1 again? |
185 "[^\0]*\0" ;size again? | 185 "\\([^\0]*\\)\0" ;size again? |
186 "[^\0]*\0" ;"y/n", executable again? | 186 "[^\0]*\0" ;"y/n", executable again? |
187 "[^\0]*\0" ;last revid? | 187 "[^\0]*\0" ;last revid? |
188 ;; There are more fields when merges are pending. | 188 ;; There are more fields when merges are pending. |
189 ) | 189 ) |
190 nil t) | 190 nil t) |
192 ;; there's a conflict, the first sha1 is absent (and the | 192 ;; there's a conflict, the first sha1 is absent (and the |
193 ;; first size seems to correspond to the file with | 193 ;; first size seems to correspond to the file with |
194 ;; conflict markers). | 194 ;; conflict markers). |
195 (cond | 195 (cond |
196 ((eq (char-after (match-beginning 1)) ?a) 'removed) | 196 ((eq (char-after (match-beginning 1)) ?a) 'removed) |
197 ((eq (char-after (match-beginning 3)) ?a) 'added) | 197 ((eq (char-after (match-beginning 4)) ?a) 'added) |
198 ((and (eq (string-to-number (match-string 2)) | 198 ((or (and (eq (string-to-number (match-string 3)) |
199 (nth 7 (file-attributes file))) | 199 (nth 7 (file-attributes file))) |
200 (equal (match-string 4) | 200 (equal (match-string 5) |
201 (vc-bzr-sha1 file))) | 201 (vc-bzr-sha1 file))) |
202 (and | |
203 ;; It looks like for lightweight | |
204 ;; checkouts \2 is empty and we need to | |
205 ;; look for size in \6. | |
206 (eq (match-beginning 2) (match-end 2)) | |
207 (eq (string-to-number (match-string 6)) | |
208 (nth 7 (file-attributes file))) | |
209 (equal (match-string 5) | |
210 (vc-bzr-sha1 file)))) | |
202 'up-to-date) | 211 'up-to-date) |
203 (t 'edited)) | 212 (t 'edited)) |
204 'unregistered)))) | 213 'unregistered)))) |
205 ;; Either the dirstate file can't be read, or the sha1 | 214 ;; Either the dirstate file can't be read, or the sha1 |
206 ;; executable is missing, or ... | 215 ;; executable is missing, or ... |