This issue seems to be that when deducing the fileset in dired mode, the code does not distinguish between files that are under version control and files that aren't.
The following patch adds detection (and filtering) of unregistered members to vc-dired-deduce-fileset.
If the marked files have any unregistered files among them, the unregistered files are filtered out.
If all files are unregistered, an error is shown. This also covers the main case of selecting just one unregistered file/directory.
=== modified file 'lisp/vc/vc.el'
--- lisp/vc/vc.el 2013-11-26 19:17:55 +0000
+++ lisp/vc/vc.el 2013-12-27 02:40:38 +0000
@@ -1014,10 +1014,19 @@
(t (error "File is not under version control")))))
(defun vc-dired-deduce-fileset ()
- (let ((backend (vc-responsible-backend default-directory)))
- (unless backend (error "Directory not under VC"))
- (list backend
- (dired-map-over-marks (dired-get-filename nil t) nil))))
+ "Deduce a set of files and a backend to which to apply an
+operation from all the marked items in a dired buffer. Resulting
+fileset only includes items that are version controlled."
+ (let ((backend (vc-responsible-backend default-directory))
+ (fileset
+ (delq nil (mapcar
+ (lambda (x) (if (not (equal (vc-backend x) nil)) x))
+ (dired-map-over-marks
+ (dired-get-filename nil t)
+ nil)))))
+ (if (not fileset)
+ (error "Marked fileset is not under version control")
+ (list backend fileset))))
(defun vc-ensure-vc-buffer ()
"Make sure that the current buffer visits a version-controlled file."