* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 31 Mar 2008 15:36:56 +0000 (15:36 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 31 Mar 2008 15:36:56 +0000 (15:36 +0000)
(vc-status-mark-buffer-changed): Handle the extra field.

* vc-bzr.el (vc-bzr-after-dir-status):
* vc-cvs.el (vc-cvs-after-dir-status):
* vc-hg.el (vc-hg-after-dir-status):
* vc-svn.el (vc-svn-after-dir-status): Return a list not a cons.

lisp/ChangeLog
lisp/vc-bzr.el
lisp/vc-cvs.el
lisp/vc-hg.el
lisp/vc-svn.el
lisp/vc.el

index ead7ac1..11848ff 100644 (file)
@@ -1,3 +1,13 @@
+2008-03-31  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
+       (vc-status-mark-buffer-changed): Handle the extra field.
+
+       * vc-bzr.el (vc-bzr-after-dir-status):
+       * vc-cvs.el (vc-cvs-after-dir-status):
+       * vc-hg.el (vc-hg-after-dir-status):
+       * vc-svn.el (vc-svn-after-dir-status): Return a list not a cons.
+
 2008-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * doc-view.el: Compute displayed pages first (in PDF).
index a875210..7425b58 100644 (file)
@@ -675,7 +675,7 @@ Optional argument LOCALP is always ignored."
              (buffer-substring-no-properties (+ (point) 4)
                                              (line-end-position)))
        (setq translated (assoc status-str translation))
-       (push (cons file (cdr translated)) result)
+       (push (list file (cdr translated)) result)
        (forward-line))
       (funcall update-function result status-buffer)))
 
index 0d76eb3..d17240e 100644 (file)
@@ -900,7 +900,7 @@ state."
       (while (looking-at "? \\(.*\\)")
        (setq file (file-relative-name 
                    (expand-file-name (match-string 1) subdir)))
-       (push (cons file 'unregistered) result)
+       (push (list file 'unregistered) result)
        (forward-line 1))
       ;; A file entry.
       (when (re-search-forward "^File: " nil t)
@@ -911,7 +911,7 @@ state."
          (setq file (file-relative-name 
                      (expand-file-name (match-string 1) subdir)))
          (if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t))
-             (push (cons file 'unregistered) result)
+             (push (list file 'unregistered) result)
            (setq status-str (match-string 1))
            (setq status
                  (cond
@@ -924,7 +924,7 @@ state."
                   ((string-match "Locally Removed" status-str) 'removed)
                   (t 'edited)))
            (unless (eq status 'up-to-date)
-             (push (cons file status) result))))))
+             (push (list file status) result))))))
       (goto-char (point-max))
       (widen))
       (funcall update-function result status-buffer)))
index b3f9547..8be1be8 100644 (file)
@@ -496,7 +496,7 @@ REV is the revision to check out into WORKFILE."
                                              (line-end-position)))
        (setq translated (assoc status-char translation))
        (when (and translated (not (eq (cdr translated) 'up-to-date)))
-         (push (cons file (cdr translated)) result))
+         (push (list file (cdr translated)) result))
        (forward-line))
       (funcall update-function result status-buffer)))
 
index 5e65d34..e36a16d 100644 (file)
@@ -174,7 +174,7 @@ If you want to force an empty list of arguments, use t."
       (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
            (filename (match-string 2)))
        (when state
-         (setq result (cons (cons filename state) result)))))
+         (setq result (cons (list filename state) result)))))
     (funcall callback result buffer)))
 
 (defun vc-svn-dir-status (dir callback buffer)
index 05293a8..3c3b51f 100644 (file)
 ;;
 ;; - dir-status (dir update-function status-buffer)
 ;;
-;;   Produce RESULT: a list of conses of the form (file . vc-state)
-;;   for the files in DIR.  If a command needs to be run to compute
-;;   this list, it should be run asynchronously using (current-buffer)
-;;   as the buffer for the command.  When RESULT is computed, it should
-;;   be passed back by doing: (funcall UPDATE-FUNCTION RESULT STATUS-BUFFER)
-;;   This function is used by `vc-status', a replacement for `vc-dired'.
+;;   Produce RESULT: a list of lists of the form (FILE VC-STATE EXTRA)
+;;   for the files in DIR.
+;;   EXTRA can be used for backend specific information about FILE.
+;;   If a command needs to be run to compute this list, it should be
+;;   run asynchronously using (current-buffer) as the buffer for the
+;;   command.  When RESULT is computed, it should be passed back by
+;;   doing: (funcall UPDATE-FUNCTION RESULT STATUS-BUFFER) This
+;;   function is used by `vc-status', a replacement for `vc-dired'.
 ;;   vc-status is still under development, and is NOT feature
 ;;   complete.  As such, the requirements for this function might
 ;;   change.  This is a replacement for `dir-state'.
@@ -2941,11 +2943,10 @@ With prefix arg READ-SWITCHES, specify a value to override
       ;; Insert the entries we got into the ewoc.
       (dolist (entry entries)
        (let* ((file (car entry))
-              (entrycdr (cdr entry))
-              (state (if (listp entrycdr) (nth 1 entry)))
-              (extra (if (listp entrycdr) (nth 2 entry))))
-       (ewoc-enter-last vc-status
-                        (vc-status-create-fileinfo file state extra))))
+              (state (nth 1 entry))
+              (extra (nth 2 entry)))
+         (ewoc-enter-last vc-status
+                          (vc-status-create-fileinfo file state extra))))
       ;; If we had marked items before the refresh, try mark them here.
       ;; XXX: there should be a better way to do this...
       (when vc-status-crt-marked
@@ -2964,7 +2965,7 @@ With prefix arg READ-SWITCHES, specify a value to override
   ;; This will be used to automatically add files with the "modified"
   ;; state when saving them.
 
-  ;; ENTRY is (FILENAME . STATE)
+  ;; ENTRY has the form (FILENAME STATE EXTRA)
   (with-current-buffer buffer
     (let ((crt (ewoc-nth vc-status 0))
          (fname (car entry)))
@@ -2976,14 +2977,13 @@ With prefix arg READ-SWITCHES, specify a value to override
       (if crt
          (progn
            ;; Found the file, just update the status.
-           (setf (vc-status-fileinfo->state (ewoc-data crt)) (cdr entry))
+           (setf (vc-status-fileinfo->state (ewoc-data crt)) (nth 1 entry))
+           (setf (vc-status-fileinfo->extra (ewoc-data crt)) (nth 2 entry))
            (ewoc-invalidate vc-status crt))
        ;; Could not find the file, insert a new entry.
        (ewoc-enter-last
-        ;; XXX: `vc-status-fileinfo->extra' is not set here.
-        ;; It might need to be.
-        vc-status 
-        (vc-status-create-fileinfo (car entry) (cdr entry) nil))))))
+        vc-status
+        (vc-status-create-fileinfo fname (nth 1 entry) (nth 2 entry)))))))
 
 (defun vc-status-refresh ()
   "Refresh the contents of the VC status buffer.
@@ -3210,6 +3210,9 @@ that share the same state."
 (defun vc-status-mark-buffer-changed (&optional fname)
   (let* ((file (or fname (expand-file-name buffer-file-name)))
         (state (and (vc-backend file) (vc-state file)))
+        ;; XXX: EXTRA is not set here.
+        ;; It might need to be.
+        (extra nil)
         (found-vc-status-buf nil))
     (save-excursion
       (dolist (status-buf (buffer-list))
@@ -3221,7 +3224,8 @@ that share the same state."
            ;; This test is cvs-string-prefix-p
            (when (eq t (compare-strings file nil (length ddir) ddir nil nil))
              (let* ((file-short (substring file (length ddir)))
-                    (entry (cons file-short (if state state 'unregistered))))
+                    (entry
+                     (list file-short (if state state 'unregistered) extra)))
                (vc-status-add-entry entry status-buf))))))
       ;; We didn't find any vc-status buffers, remove the hook, it is
       ;; not needed.