diff options
| author | Glenn Morris | 2008-10-04 20:24:24 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-10-04 20:24:24 +0000 |
| commit | a80a6b030822c104b89d36106b2bbabf74b62c60 (patch) | |
| tree | 0cc612605ceb178bf55f9922ec5764cbfacf368f /lisp | |
| parent | f3e6c9f3a480ccf5214e601caa66af6670712986 (diff) | |
| download | emacs-a80a6b030822c104b89d36106b2bbabf74b62c60.tar.gz emacs-a80a6b030822c104b89d36106b2bbabf74b62c60.zip | |
(vc-svn-after-dir-status): Handle `svn status -u' output.
(vc-svn-dir-status): Respect vc-stay-local-p. (Bug#1046)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 25 |
2 files changed, 22 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0a0c2df8c86..61004dcc163 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2008-10-04 Glenn Morris <rgm@gnu.org> | 1 | 2008-10-04 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * vc-svn.el (vc-svn-after-dir-status): Handle `svn status -u' output. | ||
| 4 | (vc-svn-dir-status): Respect vc-stay-local-p. (Bug#1046) | ||
| 5 | |||
| 3 | * vc-cvs.el (vc-cvs-dir-status-heuristic): New function. | 6 | * vc-cvs.el (vc-cvs-dir-status-heuristic): New function. |
| 4 | (vc-cvs-dir-status): Respect vc-stay-local-p. (Bug#1046) | 7 | (vc-cvs-dir-status): Respect vc-stay-local-p. (Bug#1046) |
| 5 | 8 | ||
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 06985611f47..f44b55e2a48 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; vc-svn.el --- non-resident support for Subversion version-control | 1 | ;;; vc-svn.el --- non-resident support for Subversion version-control |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Author: FSF (see vc.el for full credits) | 6 | ;; Author: FSF (see vc.el for full credits) |
| 6 | ;; Maintainer: Stefan Monnier <monnier@gnu.org> | 7 | ;; Maintainer: Stefan Monnier <monnier@gnu.org> |
| @@ -146,7 +147,9 @@ If you want to force an empty list of arguments, use t." | |||
| 146 | "SVN-specific state heuristic." | 147 | "SVN-specific state heuristic." |
| 147 | (vc-svn-state file 'local)) | 148 | (vc-svn-state file 'local)) |
| 148 | 149 | ||
| 149 | (defun vc-svn-after-dir-status (callback) | 150 | ;; FIXME it would be better not to have the "remote" argument, |
| 151 | ;; but to distinguish the two output formats based on content. | ||
| 152 | (defun vc-svn-after-dir-status (callback &optional remote) | ||
| 150 | (let ((state-map '((?A . added) | 153 | (let ((state-map '((?A . added) |
| 151 | (?C . conflict) | 154 | (?C . conflict) |
| 152 | (?D . removed) | 155 | (?D . removed) |
| @@ -156,11 +159,18 @@ If you want to force an empty list of arguments, use t." | |||
| 156 | (?? . unregistered) | 159 | (?? . unregistered) |
| 157 | ;; This is what vc-svn-parse-status does. | 160 | ;; This is what vc-svn-parse-status does. |
| 158 | (?~ . edited))) | 161 | (?~ . edited))) |
| 162 | (re (if remote "^\\(.\\)..... \\([ *]\\) +[-0-9]+ +\\(.*\\)$" | ||
| 163 | ;; Subexp 2 is a dummy in this case, so the numbers match. | ||
| 164 | "^\\(.\\)....\\(.\\) \\(.*\\)$")) | ||
| 159 | result) | 165 | result) |
| 160 | (goto-char (point-min)) | 166 | (goto-char (point-min)) |
| 161 | (while (re-search-forward "^\\(.\\)..... \\(.*\\)$" nil t) | 167 | (while (re-search-forward re nil t) |
| 162 | (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) | 168 | (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) |
| 163 | (filename (match-string 2))) | 169 | (filename (match-string 3))) |
| 170 | (and remote (string-equal (match-string 2) "*") | ||
| 171 | ;; FIXME are there other possible combinations? | ||
| 172 | (cond ((eq state 'edited) (setq state 'needs-merge)) | ||
| 173 | ((not state) (setq state 'needs-update)))) | ||
| 164 | (when state | 174 | (when state |
| 165 | (setq result (cons (list filename state) result))))) | 175 | (setq result (cons (list filename state) result))))) |
| 166 | (funcall callback result))) | 176 | (funcall callback result))) |
| @@ -169,9 +179,12 @@ If you want to force an empty list of arguments, use t." | |||
| 169 | "Run 'svn status' for DIR and update BUFFER via CALLBACK. | 179 | "Run 'svn status' for DIR and update BUFFER via CALLBACK. |
| 170 | CALLBACK is called as (CALLBACK RESULT BUFFER), where | 180 | CALLBACK is called as (CALLBACK RESULT BUFFER), where |
| 171 | RESULT is a list of conses (FILE . STATE) for directory DIR." | 181 | RESULT is a list of conses (FILE . STATE) for directory DIR." |
| 172 | (vc-svn-command (current-buffer) 'async nil "status") | 182 | ;; FIXME should this rather be all the files in dir? |
| 183 | (let ((remote (not (vc-stay-local-p dir)))) | ||
| 184 | (vc-svn-command (current-buffer) 'async nil "status" | ||
| 185 | (if remote "-u")) | ||
| 173 | (vc-exec-after | 186 | (vc-exec-after |
| 174 | `(vc-svn-after-dir-status (quote ,callback)))) | 187 | `(vc-svn-after-dir-status (quote ,callback) ,remote)))) |
| 175 | 188 | ||
| 176 | (defun vc-svn-dir-status-files (dir files default-state callback) | 189 | (defun vc-svn-dir-status-files (dir files default-state callback) |
| 177 | (apply 'vc-svn-command (current-buffer) 'async nil "status" files) | 190 | (apply 'vc-svn-command (current-buffer) 'async nil "status" files) |