changeset 87845:800f4ac6c848

* vc-svn.el (vc-svn-dir-status): New function.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 18 Jan 2008 23:45:04 +0000
parents 3bd7c8c8bbe7
children 50aec4a9ce08
files lisp/ChangeLog lisp/vc-svn.el
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jan 18 23:32:58 2008 +0000
+++ b/lisp/ChangeLog	Fri Jan 18 23:45:04 2008 +0000
@@ -1,3 +1,7 @@
+2008-01-18  Tom Tromey  <tromey@redhat.com>
+
+        * vc-svn.el (vc-svn-dir-status): New function.
+
 2008-01-18  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc.el: Make vc-status asynchronous.
--- a/lisp/vc-svn.el	Fri Jan 18 23:32:58 2008 +0000
+++ b/lisp/vc-svn.el	Fri Jan 18 23:45:04 2008 +0000
@@ -158,6 +158,29 @@
       (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
       (vc-svn-parse-status))))
 
+(defun vc-svn-dir-status (dir)
+  "Return a list of conses (FILE . STATE) for DIR."
+  (with-temp-buffer
+    (let ((default-directory (file-name-as-directory dir))
+	  (state-map '((?A . added)
+		       (?C . edited)
+		       (?D . removed)
+		       (?I . ignored)
+		       (?M . edited)
+		       (?R . removed)
+		       (?? . unregistered)
+		       ;; This is what vc-svn-parse-status does.
+		       (?~ . edited)))
+	  result)
+      (vc-svn-command t 0 nil "status")
+      (goto-char (point-min))
+      (while (re-search-forward "^\\(.\\)..... \\(.*\\)$" nil 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)))))
+      result)))
+
 (defun vc-svn-working-revision (file)
   "SVN-specific version of `vc-working-revision'."
   ;; There is no need to consult RCS headers under SVN, because we