aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-03-31 15:36:56 +0000
committerDan Nicolaescu2008-03-31 15:36:56 +0000
commit1b3f2d4ec6844540ccc6fc51b9e9568036e57236 (patch)
tree2b262c71e2ed86250adaa0fba46f4f6e7bbab58d
parentec4853ab3d2b3d7fd3586bb2617a79487d47b8a2 (diff)
downloademacs-1b3f2d4ec6844540ccc6fc51b9e9568036e57236.tar.gz
emacs-1b3f2d4ec6844540ccc6fc51b9e9568036e57236.zip
* 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.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/vc-bzr.el2
-rw-r--r--lisp/vc-cvs.el6
-rw-r--r--lisp/vc-hg.el2
-rw-r--r--lisp/vc-svn.el2
-rw-r--r--lisp/vc.el40
6 files changed, 38 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ead7ac18d28..11848ffc6ce 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12008-03-31 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
4 (vc-status-mark-buffer-changed): Handle the extra field.
5
6 * vc-bzr.el (vc-bzr-after-dir-status):
7 * vc-cvs.el (vc-cvs-after-dir-status):
8 * vc-hg.el (vc-hg-after-dir-status):
9 * vc-svn.el (vc-svn-after-dir-status): Return a list not a cons.
10
12008-03-31 Stefan Monnier <monnier@iro.umontreal.ca> 112008-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
2 12
3 * doc-view.el: Compute displayed pages first (in PDF). 13 * doc-view.el: Compute displayed pages first (in PDF).
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index a875210d183..7425b58bfcf 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -675,7 +675,7 @@ Optional argument LOCALP is always ignored."
675 (buffer-substring-no-properties (+ (point) 4) 675 (buffer-substring-no-properties (+ (point) 4)
676 (line-end-position))) 676 (line-end-position)))
677 (setq translated (assoc status-str translation)) 677 (setq translated (assoc status-str translation))
678 (push (cons file (cdr translated)) result) 678 (push (list file (cdr translated)) result)
679 (forward-line)) 679 (forward-line))
680 (funcall update-function result status-buffer))) 680 (funcall update-function result status-buffer)))
681 681
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index 0d76eb3902e..d17240e146a 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -900,7 +900,7 @@ state."
900 (while (looking-at "? \\(.*\\)") 900 (while (looking-at "? \\(.*\\)")
901 (setq file (file-relative-name 901 (setq file (file-relative-name
902 (expand-file-name (match-string 1) subdir))) 902 (expand-file-name (match-string 1) subdir)))
903 (push (cons file 'unregistered) result) 903 (push (list file 'unregistered) result)
904 (forward-line 1)) 904 (forward-line 1))
905 ;; A file entry. 905 ;; A file entry.
906 (when (re-search-forward "^File: " nil t) 906 (when (re-search-forward "^File: " nil t)
@@ -911,7 +911,7 @@ state."
911 (setq file (file-relative-name 911 (setq file (file-relative-name
912 (expand-file-name (match-string 1) subdir))) 912 (expand-file-name (match-string 1) subdir)))
913 (if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)) 913 (if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t))
914 (push (cons file 'unregistered) result) 914 (push (list file 'unregistered) result)
915 (setq status-str (match-string 1)) 915 (setq status-str (match-string 1))
916 (setq status 916 (setq status
917 (cond 917 (cond
@@ -924,7 +924,7 @@ state."
924 ((string-match "Locally Removed" status-str) 'removed) 924 ((string-match "Locally Removed" status-str) 'removed)
925 (t 'edited))) 925 (t 'edited)))
926 (unless (eq status 'up-to-date) 926 (unless (eq status 'up-to-date)
927 (push (cons file status) result)))))) 927 (push (list file status) result))))))
928 (goto-char (point-max)) 928 (goto-char (point-max))
929 (widen)) 929 (widen))
930 (funcall update-function result status-buffer))) 930 (funcall update-function result status-buffer)))
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index b3f95471fc0..8be1be82eec 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -496,7 +496,7 @@ REV is the revision to check out into WORKFILE."
496 (line-end-position))) 496 (line-end-position)))
497 (setq translated (assoc status-char translation)) 497 (setq translated (assoc status-char translation))
498 (when (and translated (not (eq (cdr translated) 'up-to-date))) 498 (when (and translated (not (eq (cdr translated) 'up-to-date)))
499 (push (cons file (cdr translated)) result)) 499 (push (list file (cdr translated)) result))
500 (forward-line)) 500 (forward-line))
501 (funcall update-function result status-buffer))) 501 (funcall update-function result status-buffer)))
502 502
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index 5e65d342f34..e36a16d7758 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -174,7 +174,7 @@ If you want to force an empty list of arguments, use t."
174 (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) 174 (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
175 (filename (match-string 2))) 175 (filename (match-string 2)))
176 (when state 176 (when state
177 (setq result (cons (cons filename state) result))))) 177 (setq result (cons (list filename state) result)))))
178 (funcall callback result buffer))) 178 (funcall callback result buffer)))
179 179
180(defun vc-svn-dir-status (dir callback buffer) 180(defun vc-svn-dir-status (dir callback buffer)
diff --git a/lisp/vc.el b/lisp/vc.el
index 05293a8cd98..3c3b51f3faa 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -169,12 +169,14 @@
169;; 169;;
170;; - dir-status (dir update-function status-buffer) 170;; - dir-status (dir update-function status-buffer)
171;; 171;;
172;; Produce RESULT: a list of conses of the form (file . vc-state) 172;; Produce RESULT: a list of lists of the form (FILE VC-STATE EXTRA)
173;; for the files in DIR. If a command needs to be run to compute 173;; for the files in DIR.
174;; this list, it should be run asynchronously using (current-buffer) 174;; EXTRA can be used for backend specific information about FILE.
175;; as the buffer for the command. When RESULT is computed, it should 175;; If a command needs to be run to compute this list, it should be
176;; be passed back by doing: (funcall UPDATE-FUNCTION RESULT STATUS-BUFFER) 176;; run asynchronously using (current-buffer) as the buffer for the
177;; This function is used by `vc-status', a replacement for `vc-dired'. 177;; command. When RESULT is computed, it should be passed back by
178;; doing: (funcall UPDATE-FUNCTION RESULT STATUS-BUFFER) This
179;; function is used by `vc-status', a replacement for `vc-dired'.
178;; vc-status is still under development, and is NOT feature 180;; vc-status is still under development, and is NOT feature
179;; complete. As such, the requirements for this function might 181;; complete. As such, the requirements for this function might
180;; change. This is a replacement for `dir-state'. 182;; change. This is a replacement for `dir-state'.
@@ -2941,11 +2943,10 @@ With prefix arg READ-SWITCHES, specify a value to override
2941 ;; Insert the entries we got into the ewoc. 2943 ;; Insert the entries we got into the ewoc.
2942 (dolist (entry entries) 2944 (dolist (entry entries)
2943 (let* ((file (car entry)) 2945 (let* ((file (car entry))
2944 (entrycdr (cdr entry)) 2946 (state (nth 1 entry))
2945 (state (if (listp entrycdr) (nth 1 entry))) 2947 (extra (nth 2 entry)))
2946 (extra (if (listp entrycdr) (nth 2 entry)))) 2948 (ewoc-enter-last vc-status
2947 (ewoc-enter-last vc-status 2949 (vc-status-create-fileinfo file state extra))))
2948 (vc-status-create-fileinfo file state extra))))
2949 ;; If we had marked items before the refresh, try mark them here. 2950 ;; If we had marked items before the refresh, try mark them here.
2950 ;; XXX: there should be a better way to do this... 2951 ;; XXX: there should be a better way to do this...
2951 (when vc-status-crt-marked 2952 (when vc-status-crt-marked
@@ -2964,7 +2965,7 @@ With prefix arg READ-SWITCHES, specify a value to override
2964 ;; This will be used to automatically add files with the "modified" 2965 ;; This will be used to automatically add files with the "modified"
2965 ;; state when saving them. 2966 ;; state when saving them.
2966 2967
2967 ;; ENTRY is (FILENAME . STATE) 2968 ;; ENTRY has the form (FILENAME STATE EXTRA)
2968 (with-current-buffer buffer 2969 (with-current-buffer buffer
2969 (let ((crt (ewoc-nth vc-status 0)) 2970 (let ((crt (ewoc-nth vc-status 0))
2970 (fname (car entry))) 2971 (fname (car entry)))
@@ -2976,14 +2977,13 @@ With prefix arg READ-SWITCHES, specify a value to override
2976 (if crt 2977 (if crt
2977 (progn 2978 (progn
2978 ;; Found the file, just update the status. 2979 ;; Found the file, just update the status.
2979 (setf (vc-status-fileinfo->state (ewoc-data crt)) (cdr entry)) 2980 (setf (vc-status-fileinfo->state (ewoc-data crt)) (nth 1 entry))
2981 (setf (vc-status-fileinfo->extra (ewoc-data crt)) (nth 2 entry))
2980 (ewoc-invalidate vc-status crt)) 2982 (ewoc-invalidate vc-status crt))
2981 ;; Could not find the file, insert a new entry. 2983 ;; Could not find the file, insert a new entry.
2982 (ewoc-enter-last 2984 (ewoc-enter-last
2983 ;; XXX: `vc-status-fileinfo->extra' is not set here. 2985 vc-status
2984 ;; It might need to be. 2986 (vc-status-create-fileinfo fname (nth 1 entry) (nth 2 entry)))))))
2985 vc-status
2986 (vc-status-create-fileinfo (car entry) (cdr entry) nil))))))
2987 2987
2988(defun vc-status-refresh () 2988(defun vc-status-refresh ()
2989 "Refresh the contents of the VC status buffer. 2989 "Refresh the contents of the VC status buffer.
@@ -3210,6 +3210,9 @@ that share the same state."
3210(defun vc-status-mark-buffer-changed (&optional fname) 3210(defun vc-status-mark-buffer-changed (&optional fname)
3211 (let* ((file (or fname (expand-file-name buffer-file-name))) 3211 (let* ((file (or fname (expand-file-name buffer-file-name)))
3212 (state (and (vc-backend file) (vc-state file))) 3212 (state (and (vc-backend file) (vc-state file)))
3213 ;; XXX: EXTRA is not set here.
3214 ;; It might need to be.
3215 (extra nil)
3213 (found-vc-status-buf nil)) 3216 (found-vc-status-buf nil))
3214 (save-excursion 3217 (save-excursion
3215 (dolist (status-buf (buffer-list)) 3218 (dolist (status-buf (buffer-list))
@@ -3221,7 +3224,8 @@ that share the same state."
3221 ;; This test is cvs-string-prefix-p 3224 ;; This test is cvs-string-prefix-p
3222 (when (eq t (compare-strings file nil (length ddir) ddir nil nil)) 3225 (when (eq t (compare-strings file nil (length ddir) ddir nil nil))
3223 (let* ((file-short (substring file (length ddir))) 3226 (let* ((file-short (substring file (length ddir)))
3224 (entry (cons file-short (if state state 'unregistered)))) 3227 (entry
3228 (list file-short (if state state 'unregistered) extra)))
3225 (vc-status-add-entry entry status-buf)))))) 3229 (vc-status-add-entry entry status-buf))))))
3226 ;; We didn't find any vc-status buffers, remove the hook, it is 3230 ;; We didn't find any vc-status buffers, remove the hook, it is
3227 ;; not needed. 3231 ;; not needed.