aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-04-10 15:03:27 +0000
committerDan Nicolaescu2008-04-10 15:03:27 +0000
commit21f7bc38bd59c9fd001da737808701ce3597e339 (patch)
tree9421a89ca93dd2341596b42755d1a8b2fe7473c0
parentcbee283dd7dd655124e81a6bd555506476180b5d (diff)
downloademacs-21f7bc38bd59c9fd001da737808701ce3597e339.tar.gz
emacs-21f7bc38bd59c9fd001da737808701ce3597e339.zip
(vc-bzr-after-dir-status): Detect the conflict state.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc-bzr.el25
2 files changed, 23 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5f202701639..e8603f406f8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12008-04-10 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * vc-bzr.el (vc-bzr-after-dir-status): Detect the conflict state.
4
12008-04-10 Juanma Barranquero <lekktu@gmail.com> 52008-04-10 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * subr.el (assoc-ignore-case, assoc-ignore-representation): 7 * subr.el (assoc-ignore-case, assoc-ignore-representation):
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."
657 ;; else fall back to default vc.el representation 657 ;; else fall back to default vc.el representation
658 (vc-default-dired-state-info 'Bzr file))) 658 (vc-default-dired-state-info 'Bzr file)))
659 659
660;; XXX Experimental function for the vc-dired replacement.
661;; XXX: this needs testing, it's probably incomplete. 660;; XXX: this needs testing, it's probably incomplete.
662(defun vc-bzr-after-dir-status (update-function status-buffer) 661(defun vc-bzr-after-dir-status (update-function status-buffer)
663 (let ((status-str nil) 662 (let ((status-str nil)
@@ -667,6 +666,7 @@ Optional argument LOCALP is always ignored."
667 (" M" . edited) 666 (" M" . edited)
668 ;; XXX: what about ignored files? 667 ;; XXX: what about ignored files?
669 (" D" . missing) 668 (" D" . missing)
669 ("C " . conflict)
670 ("? " . unregistered))) 670 ("? " . unregistered)))
671 (translated nil) 671 (translated nil)
672 (result nil)) 672 (result nil))
@@ -674,11 +674,24 @@ Optional argument LOCALP is always ignored."
674 (while (not (eobp)) 674 (while (not (eobp))
675 (setq status-str 675 (setq status-str
676 (buffer-substring-no-properties (point) (+ (point) 2))) 676 (buffer-substring-no-properties (point) (+ (point) 2)))
677 (setq file 677 (setq translated (cdr (assoc status-str translation)))
678 (buffer-substring-no-properties (+ (point) 4) 678 ;; For conflicts the file appears twice in the listing: once
679 (line-end-position))) 679 ;; with the M flag and once with the C flag, so take care not
680 (setq translated (assoc status-str translation)) 680 ;; to add it twice to `result'. Ugly.
681 (push (list file (cdr translated)) result) 681 (if (eq translated 'conflict)
682 (let* ((file
683 (buffer-substring-no-properties
684 ;;For files with conflicts the format is:
685 ;;C Text conflict in FILENAME
686 ;; Bah.
687 (+ (point) 21) (line-end-position)))
688 (entry (assoc file result)))
689 (when entry
690 (setf (nth 1 entry) 'conflict)))
691 (push (list (buffer-substring-no-properties
692 (+ (point) 4)
693 (line-end-position))
694 translated) result))
682 (forward-line)) 695 (forward-line))
683 (funcall update-function result status-buffer))) 696 (funcall update-function result status-buffer)))
684 697