* vc.el (vc-do-command): Condition out a misleading message when
running asynchronously.
+ (vc-deduce-fileset): New argument enables using an unregistered
+ visited file as a singleton fileset idf nothing else is available.
+ (vc-next-action): Restore file-registering behavior.
2007-10-20 Jay Belanger <jay.p.belanger@gmail.com>
node (lambda (f) (if (vc-backend f) (push f flattened)))))
(nreverse flattened)))
-(defun vc-deduce-fileset (&optional allow-directory-wildcard)
+(defun vc-deduce-fileset (&optional allow-directory-wildcard allow-unregistered)
"Deduce a set of files and a backend to which to apply an operation.
If we're in VC-dired mode, the fileset is the list of marked files.
the fileset is a singleton containing this file.
If neither of these things is true, but ALLOW-DIRECTORY-WILDCARD is on
and we're in a dired buffer, select the current directory.
+If none of these conditions is met, but ALLOW_UNREGISTERED is in and the
+visited file is not registered, return a singletin fileset containing it.
Otherwise, throw an error."
(cond (vc-dired-mode
(let ((marked (dired-map-over-marks (dired-get-filename) nil)))
(message "All version-controlled files below %s selected."
default-directory)
(list default-directory)))
+ ((and allow-unregistered (not (vc-registered buffer-file-name)))
+ (list buffer-file-name))
(t (error "No fileset is available here."))))
(defun vc-ensure-vc-buffer ()
If the repository file is changed, you are asked if you want to
merge in the changes into your working copy."
(interactive "P")
- (let* ((files (vc-deduce-fileset))
+ (let* ((files (vc-deduce-fileset nil t))
(state (vc-state (car files)))
(model (vc-checkout-model (car files)))
revision)