changeset 92165:6bb6b2500e35

(vc-rcs-register): Fix treatment of directories in multiple file case. Use a single `let' rather than two.
author Glenn Morris <rgm@gnu.org>
date Sun, 24 Feb 2008 23:02:09 +0000
parents 9ec23fe6e33c
children e8699ffb4bb9
files lisp/vc-rcs.el
diffstat 1 files changed, 24 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-rcs.el	Sun Feb 24 22:54:30 2008 +0000
+++ b/lisp/vc-rcs.el	Sun Feb 24 23:02:09 2008 +0000
@@ -262,9 +262,11 @@
 
 Automatically retrieve a read-only version of the file with keywords
 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
-  (let ((subdir (expand-file-name "RCS" (file-name-directory file))))
+  (let (subdir name)
     (dolist (file files)
-      (and (not (file-exists-p subdir))
+      (and (not (file-exists-p
+		 (setq subdir (expand-file-name "RCS"
+						(file-name-directory file)))))
 	   (not (directory-files (file-name-directory file)
 				 nil ".*,v$" t))
 	   (yes-or-no-p "Create RCS subdirectory? ")
@@ -277,26 +279,26 @@
 	     (vc-switches 'RCS 'register))
       ;; parse output to find master file name and workfile version
       (with-current-buffer "*vc*"
-        (goto-char (point-min))
-        (let ((name (if (looking-at (concat "^\\(.*\\)  <--  "
-                                            (file-name-nondirectory file)))
-                        (match-string 1))))
-          (if (not name)
-              ;; if we couldn't find the master name,
-              ;; run vc-rcs-registered to get it
-              ;; (will be stored into the vc-name property)
-              (vc-rcs-registered file)
-            (vc-file-setprop file 'vc-name
-                             (if (file-name-absolute-p name)
-                                 name
-                               (expand-file-name
-                                name
-                                (file-name-directory file))))))
-        (vc-file-setprop file 'vc-working-revision
-                         (if (re-search-forward
-                              "^initial revision: \\([0-9.]+\\).*\n"
-                              nil t)
-                             (match-string 1)))))))
+	(goto-char (point-min))
+	(if (not (setq name
+		       (if (looking-at (concat "^\\(.*\\)  <--	"
+					       (file-name-nondirectory file)))
+			   (match-string 1))))
+	    ;; if we couldn't find the master name,
+	    ;; run vc-rcs-registered to get it
+	    ;; (will be stored into the vc-name property)
+	    (vc-rcs-registered file)
+	  (vc-file-setprop file 'vc-name
+			   (if (file-name-absolute-p name)
+			       name
+			     (expand-file-name
+			      name
+			      (file-name-directory file))))))
+      (vc-file-setprop file 'vc-working-revision
+		       (if (re-search-forward
+			    "^initial revision: \\([0-9.]+\\).*\n"
+			    nil t)
+			   (match-string 1))))))
 
 (defun vc-rcs-responsible-p (file)
   "Return non-nil if RCS thinks it would be responsible for registering FILE."