]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-cvs-register): Fix registering of directories in multiple file case.
authorGlenn Morris <rgm@gnu.org>
Sun, 24 Feb 2008 22:54:30 +0000 (22:54 +0000)
committerGlenn Morris <rgm@gnu.org>
Sun, 24 Feb 2008 22:54:30 +0000 (22:54 +0000)
lisp/ChangeLog
lisp/vc-cvs.el

index b7d40b19998887cd76ca16dc7207573fa455d463..a92eb1b6f44e0055bd033d52071d126c3d2dd508 100644 (file)
@@ -1,5 +1,8 @@
 2008-02-24  Glenn Morris  <rgm@gnu.org>
 
+       * vc-cvs.el (vc-cvs-register): Fix registering of directories in
+       multiple file case.
+
        * vc-mcvs.el (vc-mcvs-register): Fix let-binding (for use of `file').
 
 2008-02-24  Dan Nicolaescu  <dann@ics.uci.edu>
index 717407d2cbd049445226f2f7b07e2f03c3bd1890..975a24dcd4d4ca717e21be34b17e16dc862a4421 100644 (file)
@@ -298,15 +298,18 @@ COMMENT can be used to provide an initial description of FILES.
 
 `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."