summaryrefslogtreecommitdiff
path: root/lisp/vc-bzr.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2008-04-10 15:03:27 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2008-04-10 15:03:27 +0000
commit21f7bc38bd59c9fd001da737808701ce3597e339 (patch)
tree9421a89ca93dd2341596b42755d1a8b2fe7473c0 /lisp/vc-bzr.el
parentcbee283dd7dd655124e81a6bd555506476180b5d (diff)
downloademacs-21f7bc38bd59c9fd001da737808701ce3597e339.tar.gz
(vc-bzr-after-dir-status): Detect the conflict state.
Diffstat (limited to 'lisp/vc-bzr.el')
-rw-r--r--lisp/vc-bzr.el25
1 files changed, 19 insertions, 6 deletions
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index ff17ee4e9bb..87335c63f12 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -657,7 +657,6 @@ Optional argument LOCALP is always ignored."
;; else fall back to default vc.el representation
(vc-default-dired-state-info 'Bzr file)))
-;; XXX Experimental function for the vc-dired replacement.
;; XXX: this needs testing, it's probably incomplete.
(defun vc-bzr-after-dir-status (update-function status-buffer)
(let ((status-str nil)
@@ -667,6 +666,7 @@ Optional argument LOCALP is always ignored."
(" M" . edited)
;; XXX: what about ignored files?
(" D" . missing)
+ ("C " . conflict)
("? " . unregistered)))
(translated nil)
(result nil))
@@ -674,11 +674,24 @@ Optional argument LOCALP is always ignored."
(while (not (eobp))
(setq status-str
(buffer-substring-no-properties (point) (+ (point) 2)))
- (setq file
- (buffer-substring-no-properties (+ (point) 4)
- (line-end-position)))
- (setq translated (assoc status-str translation))
- (push (list file (cdr translated)) result)
+ (setq translated (cdr (assoc status-str translation)))
+ ;; For conflicts the file appears twice in the listing: once
+ ;; with the M flag and once with the C flag, so take care not
+ ;; to add it twice to `result'. Ugly.
+ (if (eq translated 'conflict)
+ (let* ((file
+ (buffer-substring-no-properties
+ ;;For files with conflicts the format is:
+ ;;C Text conflict in FILENAME
+ ;; Bah.
+ (+ (point) 21) (line-end-position)))
+ (entry (assoc file result)))
+ (when entry
+ (setf (nth 1 entry) 'conflict)))
+ (push (list (buffer-substring-no-properties
+ (+ (point) 4)
+ (line-end-position))
+ translated) result))
(forward-line))
(funcall update-function result status-buffer)))