]> code.delx.au - gnu-emacs/commitdiff
(vc-locked-example): Renamed from vc-quiescent-p. Now yields example of
authorPaul Eggert <eggert@twinsun.com>
Fri, 27 Aug 1993 03:55:16 +0000 (03:55 +0000)
committerPaul Eggert <eggert@twinsun.com>
Fri, 27 Aug 1993 03:55:16 +0000 (03:55 +0000)
why current directory is not quiescent.  All callers changed to use this.

lisp/vc.el

index f84b721db734c28640bc2ce3bc4dee94e5c5c234..205bc266d0df5455f7ed9638672ff03b3bc8c062 100644 (file)
@@ -995,14 +995,15 @@ on a buffer attached to the file named in the current Dired buffer line."
 
 ;; Named-configuration entry points
 
-(defun vc-quiescent-p ()
-  ;; Is the current directory ready to be snapshot?
-  (catch 'quiet
+(defun vc-locked-example ()
+  ;; Return an example of why the current directory is not ready to be snapshot
+  ;; or nil if no such example exists.
+  (catch 'vc-locked-example
     (vc-file-tree-walk
      (function (lambda (f)
                 (if (and (vc-registered f) (vc-locking-user f))
-                    (throw 'quiet nil)))))
-    t))
+                    (throw 'vc-locked-example f)))))
+    nil))
 
 ;;;###autoload
 (defun vc-create-snapshot (name)
@@ -1011,13 +1012,14 @@ The snapshot is made from all registered files at or below the current
 directory.  For each file, the version level of its latest
 version becomes part of the named configuration."
   (interactive "sNew snapshot name: ")
-  (if (not (vc-quiescent-p))
-      (error "Can't make a snapshot since some files are locked")
-    (vc-file-tree-walk
-     (function (lambda (f) (and
-                  (vc-name f)
-                  (vc-backend-assign-name f name)))))
-    ))
+  (let ((locked (vc-locked-example)))
+    (if locked
+       (error "File %s is locked" locked)
+      (vc-file-tree-walk
+       (function (lambda (f) (and
+                             (vc-name f)
+                             (vc-backend-assign-name f name)))))
+      )))
 
 ;;;###autoload
 (defun vc-retrieve-snapshot (name)
@@ -1026,13 +1028,15 @@ This function fails if any files are locked at or below the current directory
 Otherwise, all registered files are checked out (unlocked) at their version
 levels in the snapshot."
   (interactive "sSnapshot name to retrieve: ")
-  (if (not (vc-quiescent-p))
-      (error "Can't retrieve snapshot sine some files are locked")
-    (vc-file-tree-walk
-     (function (lambda (f) (and
-                  (vc-name f)
-                  (vc-error-occurred (vc-backend-checkout f nil name))))))
-    ))
+  (let ((locked (vc-locked-example)))
+    (if locked
+       (error "File %s is locked" locked)
+      (vc-file-tree-walk
+       (function (lambda (f) (and
+                             (vc-name f)
+                             (vc-error-occurred
+                              (vc-backend-checkout f nil name))))))
+      )))
 
 ;; Miscellaneous other entry points