diff options
| author | Paul Eggert | 1993-08-27 03:55:16 +0000 |
|---|---|---|
| committer | Paul Eggert | 1993-08-27 03:55:16 +0000 |
| commit | 1dabb4e676c79256ce0d9431db08981b9278960d (patch) | |
| tree | 8925f8b5d956a84a4550eba4dce23f57a76e3bb5 | |
| parent | 6379911ca3314bd2aaf2ad1c14c7726abd86e50f (diff) | |
| download | emacs-1dabb4e676c79256ce0d9431db08981b9278960d.tar.gz emacs-1dabb4e676c79256ce0d9431db08981b9278960d.zip | |
(vc-locked-example): Renamed from vc-quiescent-p. Now yields example of
why current directory is not quiescent. All callers changed to use this.
| -rw-r--r-- | lisp/vc.el | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index f84b721db73..205bc266d0d 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -995,14 +995,15 @@ on a buffer attached to the file named in the current Dired buffer line." | |||
| 995 | 995 | ||
| 996 | ;; Named-configuration entry points | 996 | ;; Named-configuration entry points |
| 997 | 997 | ||
| 998 | (defun vc-quiescent-p () | 998 | (defun vc-locked-example () |
| 999 | ;; Is the current directory ready to be snapshot? | 999 | ;; Return an example of why the current directory is not ready to be snapshot |
| 1000 | (catch 'quiet | 1000 | ;; or nil if no such example exists. |
| 1001 | (catch 'vc-locked-example | ||
| 1001 | (vc-file-tree-walk | 1002 | (vc-file-tree-walk |
| 1002 | (function (lambda (f) | 1003 | (function (lambda (f) |
| 1003 | (if (and (vc-registered f) (vc-locking-user f)) | 1004 | (if (and (vc-registered f) (vc-locking-user f)) |
| 1004 | (throw 'quiet nil))))) | 1005 | (throw 'vc-locked-example f))))) |
| 1005 | t)) | 1006 | nil)) |
| 1006 | 1007 | ||
| 1007 | ;;;###autoload | 1008 | ;;;###autoload |
| 1008 | (defun vc-create-snapshot (name) | 1009 | (defun vc-create-snapshot (name) |
| @@ -1011,13 +1012,14 @@ The snapshot is made from all registered files at or below the current | |||
| 1011 | directory. For each file, the version level of its latest | 1012 | directory. For each file, the version level of its latest |
| 1012 | version becomes part of the named configuration." | 1013 | version becomes part of the named configuration." |
| 1013 | (interactive "sNew snapshot name: ") | 1014 | (interactive "sNew snapshot name: ") |
| 1014 | (if (not (vc-quiescent-p)) | 1015 | (let ((locked (vc-locked-example))) |
| 1015 | (error "Can't make a snapshot since some files are locked") | 1016 | (if locked |
| 1016 | (vc-file-tree-walk | 1017 | (error "File %s is locked" locked) |
| 1017 | (function (lambda (f) (and | 1018 | (vc-file-tree-walk |
| 1018 | (vc-name f) | 1019 | (function (lambda (f) (and |
| 1019 | (vc-backend-assign-name f name))))) | 1020 | (vc-name f) |
| 1020 | )) | 1021 | (vc-backend-assign-name f name))))) |
| 1022 | ))) | ||
| 1021 | 1023 | ||
| 1022 | ;;;###autoload | 1024 | ;;;###autoload |
| 1023 | (defun vc-retrieve-snapshot (name) | 1025 | (defun vc-retrieve-snapshot (name) |
| @@ -1026,13 +1028,15 @@ This function fails if any files are locked at or below the current directory | |||
| 1026 | Otherwise, all registered files are checked out (unlocked) at their version | 1028 | Otherwise, all registered files are checked out (unlocked) at their version |
| 1027 | levels in the snapshot." | 1029 | levels in the snapshot." |
| 1028 | (interactive "sSnapshot name to retrieve: ") | 1030 | (interactive "sSnapshot name to retrieve: ") |
| 1029 | (if (not (vc-quiescent-p)) | 1031 | (let ((locked (vc-locked-example))) |
| 1030 | (error "Can't retrieve snapshot sine some files are locked") | 1032 | (if locked |
| 1031 | (vc-file-tree-walk | 1033 | (error "File %s is locked" locked) |
| 1032 | (function (lambda (f) (and | 1034 | (vc-file-tree-walk |
| 1033 | (vc-name f) | 1035 | (function (lambda (f) (and |
| 1034 | (vc-error-occurred (vc-backend-checkout f nil name)))))) | 1036 | (vc-name f) |
| 1035 | )) | 1037 | (vc-error-occurred |
| 1038 | (vc-backend-checkout f nil name)))))) | ||
| 1039 | ))) | ||
| 1036 | 1040 | ||
| 1037 | ;; Miscellaneous other entry points | 1041 | ;; Miscellaneous other entry points |
| 1038 | 1042 | ||