aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc-svn.el50
2 files changed, 33 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cab7c60b452..30ab6bda2a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-01-19 Tom Tromey <tromey@redhat.com>
2
3 * vc-svn.el (vc-svn-after-dir-status): New function.
4 (vc-svn-dir-status): Run svn asynchronously.
5
12008-01-19 Martin Rudalics <rudalics@gmx.at> 62008-01-19 Martin Rudalics <rudalics@gmx.at>
2 7
3 * progmodes/hideif.el (hide-ifdef-shadow): New option. 8 * progmodes/hideif.el (hide-ifdef-shadow): New option.
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index b8d04d67c70..b3db2df7f69 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -158,28 +158,34 @@ If you want to force an empty list of arguments, use t."
158 (vc-svn-command t 0 nil "status" (if localp "-v" "-u")) 158 (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
159 (vc-svn-parse-status)))) 159 (vc-svn-parse-status))))
160 160
161(defun vc-svn-dir-status (dir) 161(defun vc-svn-after-dir-status (callback buffer)
162 "Return a list of conses (FILE . STATE) for DIR." 162 (let ((state-map '((?A . added)
163 (with-temp-buffer 163 (?C . edited)
164 (let ((default-directory (file-name-as-directory dir)) 164 (?D . removed)
165 (state-map '((?A . added) 165 (?I . ignored)
166 (?C . edited) 166 (?M . edited)
167 (?D . removed) 167 (?R . removed)
168 (?I . ignored) 168 (?? . unregistered)
169 (?M . edited) 169 ;; This is what vc-svn-parse-status does.
170 (?R . removed) 170 (?~ . edited)))
171 (?? . unregistered) 171 result)
172 ;; This is what vc-svn-parse-status does. 172 (goto-char (point-min))
173 (?~ . edited))) 173 (while (re-search-forward "^\\(.\\)..... \\(.*\\)$" nil t)
174 result) 174 (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
175 (vc-svn-command t 0 nil "status") 175 (filename (match-string 2)))
176 (goto-char (point-min)) 176 (when state
177 (while (re-search-forward "^\\(.\\)..... \\(.*\\)$" nil t) 177 (setq result (cons (cons filename state) result)))))
178 (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) 178 (funcall callback result buffer)))
179 (filename (match-string 2))) 179
180 (when state 180(defun vc-svn-dir-status (dir callback buffer)
181 (setq result (cons (cons filename state) result))))) 181 "Run 'svn status' for DIR and update BUFFER via CALLBACK.
182 result))) 182CALLBACK is called as (CALLBACK RESULT BUFFER), where
183RESULT is a list of conses (FILE . STATE) for directory DIR."
184 (with-current-buffer (get-buffer-create
185 (generate-new-buffer-name " *vc svn status*"))
186 (vc-svn-command (current-buffer) 'async nil "status")
187 (vc-exec-after
188 `(vc-svn-after-dir-status (quote ,callback) ,buffer))))
183 189
184(defun vc-svn-working-revision (file) 190(defun vc-svn-working-revision (file)
185 "SVN-specific version of `vc-working-revision'." 191 "SVN-specific version of `vc-working-revision'."