comparison lisp/vc-svn.el @ 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 8f1628da223f
children cec6a1fe32a4
comparison
equal deleted inserted replaced
87844:3bd7c8c8bbe7 87845:800f4ac6c848
155 ;; enough. Otherwise it might fail with remote repositories. 155 ;; enough. Otherwise it might fail with remote repositories.
156 (with-temp-buffer 156 (with-temp-buffer
157 (buffer-disable-undo) ;; Because these buffers can get huge 157 (buffer-disable-undo) ;; Because these buffers can get huge
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
161 (defun vc-svn-dir-status (dir)
162 "Return a list of conses (FILE . STATE) for DIR."
163 (with-temp-buffer
164 (let ((default-directory (file-name-as-directory dir))
165 (state-map '((?A . added)
166 (?C . edited)
167 (?D . removed)
168 (?I . ignored)
169 (?M . edited)
170 (?R . removed)
171 (?? . unregistered)
172 ;; This is what vc-svn-parse-status does.
173 (?~ . edited)))
174 result)
175 (vc-svn-command t 0 nil "status")
176 (goto-char (point-min))
177 (while (re-search-forward "^\\(.\\)..... \\(.*\\)$" nil t)
178 (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
179 (filename (match-string 2)))
180 (when state
181 (setq result (cons (cons filename state) result)))))
182 result)))
160 183
161 (defun vc-svn-working-revision (file) 184 (defun vc-svn-working-revision (file)
162 "SVN-specific version of `vc-working-revision'." 185 "SVN-specific version of `vc-working-revision'."
163 ;; There is no need to consult RCS headers under SVN, because we 186 ;; There is no need to consult RCS headers under SVN, because we
164 ;; get the workfile version for free when we recognize that a file 187 ;; get the workfile version for free when we recognize that a file