# HG changeset patch # User Glenn Morris # Date 1203893648 0 # Node ID 12326ccb66d6b0075bf6009e4e98f896d63fcadc # Parent 9c14521521cfd3f39f8db212ea82d76433de4a53 (vc-cvs-register): Fix registering of directories in multiple file case. diff -r 9c14521521cf -r 12326ccb66d6 lisp/vc-cvs.el --- a/lisp/vc-cvs.el Sun Feb 24 22:51:00 2008 +0000 +++ b/lisp/vc-cvs.el Sun Feb 24 22:54:08 2008 +0000 @@ -298,15 +298,18 @@ `vc-register-switches' and `vc-cvs-register-switches' are passed to the CVS command (in that order)." - (when (and (not (vc-cvs-responsible-p file)) - (vc-cvs-could-register file)) - ;; Register the directory if needed. - (vc-cvs-register (directory-file-name (file-name-directory file)))) - (apply 'vc-cvs-command nil 0 files - "add" - (and comment (string-match "[^\t\n ]" comment) - (concat "-m" comment)) - (vc-switches 'CVS 'register))) + ;; Register the directories if needed. + (let (dirs) + (dolist (file files) + (and (not (vc-cvs-responsible-p file)) + (vc-cvs-could-register file) + (push (directory-file-name (file-name-directory file)) dirs))) + (if dirs (vc-cvs-register dirs))) + (apply 'vc-cvs-command nil 0 files + "add" + (and comment (string-match "[^\t\n ]" comment) + (concat "-m" comment)) + (vc-switches 'CVS 'register))) (defun vc-cvs-responsible-p (file) "Return non-nil if CVS thinks it is responsible for FILE."