diff options
| author | Eric S. Raymond | 2007-10-20 21:02:46 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 2007-10-20 21:02:46 +0000 |
| commit | ccd9fab66ac3bc563c0a6153b356940f60cd374d (patch) | |
| tree | fe80015ef5f771e3114f9de620f279e668610548 | |
| parent | db3534c36a3a8e8fb1eca61100aae540b4e45d6f (diff) | |
| download | emacs-ccd9fab66ac3bc563c0a6153b356940f60cd374d.tar.gz emacs-ccd9fab66ac3bc563c0a6153b356940f60cd374d.zip | |
Restore vc-next-action functionality of registering files.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/vc.el | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1636bdba6a3..aeef4eb1e92 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | * vc.el (vc-do-command): Condition out a misleading message when | 3 | * vc.el (vc-do-command): Condition out a misleading message when |
| 4 | running asynchronously. | 4 | running asynchronously. |
| 5 | (vc-deduce-fileset): New argument enables using an unregistered | ||
| 6 | visited file as a singleton fileset idf nothing else is available. | ||
| 7 | (vc-next-action): Restore file-registering behavior. | ||
| 5 | 8 | ||
| 6 | 2007-10-20 Jay Belanger <jay.p.belanger@gmail.com> | 9 | 2007-10-20 Jay Belanger <jay.p.belanger@gmail.com> |
| 7 | 10 | ||
diff --git a/lisp/vc.el b/lisp/vc.el index 36df6d1f5c3..27400bf87f6 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -1244,7 +1244,7 @@ Only files already under version control are noticed." | |||
| 1244 | node (lambda (f) (if (vc-backend f) (push f flattened))))) | 1244 | node (lambda (f) (if (vc-backend f) (push f flattened))))) |
| 1245 | (nreverse flattened))) | 1245 | (nreverse flattened))) |
| 1246 | 1246 | ||
| 1247 | (defun vc-deduce-fileset (&optional allow-directory-wildcard) | 1247 | (defun vc-deduce-fileset (&optional allow-directory-wildcard allow-unregistered) |
| 1248 | "Deduce a set of files and a backend to which to apply an operation. | 1248 | "Deduce a set of files and a backend to which to apply an operation. |
| 1249 | 1249 | ||
| 1250 | If we're in VC-dired mode, the fileset is the list of marked files. | 1250 | If we're in VC-dired mode, the fileset is the list of marked files. |
| @@ -1252,6 +1252,8 @@ Otherwise, if we're looking at a buffer visiting a version-controlled file, | |||
| 1252 | the fileset is a singleton containing this file. | 1252 | the fileset is a singleton containing this file. |
| 1253 | If neither of these things is true, but ALLOW-DIRECTORY-WILDCARD is on | 1253 | If neither of these things is true, but ALLOW-DIRECTORY-WILDCARD is on |
| 1254 | and we're in a dired buffer, select the current directory. | 1254 | and we're in a dired buffer, select the current directory. |
| 1255 | If none of these conditions is met, but ALLOW_UNREGISTERED is in and the | ||
| 1256 | visited file is not registered, return a singletin fileset containing it. | ||
| 1255 | Otherwise, throw an error." | 1257 | Otherwise, throw an error." |
| 1256 | (cond (vc-dired-mode | 1258 | (cond (vc-dired-mode |
| 1257 | (let ((marked (dired-map-over-marks (dired-get-filename) nil))) | 1259 | (let ((marked (dired-map-over-marks (dired-get-filename) nil))) |
| @@ -1284,6 +1286,8 @@ Otherwise, throw an error." | |||
| 1284 | (message "All version-controlled files below %s selected." | 1286 | (message "All version-controlled files below %s selected." |
| 1285 | default-directory) | 1287 | default-directory) |
| 1286 | (list default-directory))) | 1288 | (list default-directory))) |
| 1289 | ((and allow-unregistered (not (vc-registered buffer-file-name))) | ||
| 1290 | (list buffer-file-name)) | ||
| 1287 | (t (error "No fileset is available here.")))) | 1291 | (t (error "No fileset is available here.")))) |
| 1288 | 1292 | ||
| 1289 | (defun vc-ensure-vc-buffer () | 1293 | (defun vc-ensure-vc-buffer () |
| @@ -1369,7 +1373,7 @@ with the logmessage as change commentary. A writable file is retained. | |||
| 1369 | If the repository file is changed, you are asked if you want to | 1373 | If the repository file is changed, you are asked if you want to |
| 1370 | merge in the changes into your working copy." | 1374 | merge in the changes into your working copy." |
| 1371 | (interactive "P") | 1375 | (interactive "P") |
| 1372 | (let* ((files (vc-deduce-fileset)) | 1376 | (let* ((files (vc-deduce-fileset nil t)) |
| 1373 | (state (vc-state (car files))) | 1377 | (state (vc-state (car files))) |
| 1374 | (model (vc-checkout-model (car files))) | 1378 | (model (vc-checkout-model (car files))) |
| 1375 | revision) | 1379 | revision) |