changeset 94289:82466e0389bb

(vc-next-action): Look at more than the first file to determine the state.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 23 Apr 2008 04:05:26 +0000
parents f2134121363a
children 55b13d307a7a
files lisp/ChangeLog lisp/vc.el
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Apr 23 03:27:13 2008 +0000
+++ b/lisp/ChangeLog	Wed Apr 23 04:05:26 2008 +0000
@@ -1,3 +1,8 @@
+2008-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc.el (vc-next-action): Look at more than the first file to
+	determine the state.
+
 2008-04-23  Glenn Morris  <rgm@gnu.org>
 
 	* dframe.el (dframe-have-timer-flag): Drop support for Emacs without
--- a/lisp/vc.el	Wed Apr 23 03:27:13 2008 +0000
+++ b/lisp/vc.el	Wed Apr 23 04:05:26 2008 +0000
@@ -1580,9 +1580,19 @@
   (interactive "P")
   (let* ((vc-fileset (vc-deduce-fileset nil t))
 	 (files (cdr vc-fileset))
-	 (state (vc-state (car files)))
-	 (model (vc-checkout-model (car files)))
+	 state
+	 model
 	 revision)
+    ;; Check if there's at least one file present, and get `state' and
+    ;; `model' from it.
+    ;;FIXME: do something about the case when only directories are
+    ;; present, or `files' is nil.
+    (dolist (file files)
+      (unless (file-directory-p file)
+	(setq model (vc-checkout-model (car files)))
+	(setq state (vc-state file))
+	(return)))
+    
     ;; Verify that the fileset is homogeneous
     (dolist (file (cdr files))
       ;; Ignore directories, they are compatible with anything.