Mercurial > emacs
comparison lisp/vc.el @ 4656:29bd5f3d0059
(vc-locked-example): Renamed from vc-quiescent-p. Now yields example of
why current directory is not quiescent. All callers changed to use this.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Fri, 27 Aug 1993 03:55:16 +0000 |
parents | aeef9d07f78d |
children | 23b11c3b86b3 |
comparison
equal
deleted
inserted
replaced
4655:604a401e05a4 | 4656:29bd5f3d0059 |
---|---|
993 (list (concat name "\t:\t" file "\t\\(.+\\)")))) | 993 (list (concat name "\t:\t" file "\t\\(.+\\)")))) |
994 ))) | 994 ))) |
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) |
1009 "Make a snapshot called NAME. | 1010 "Make a snapshot called NAME. |
1010 The snapshot is made from all registered files at or below the current | 1011 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) |
1024 "Retrieve the snapshot called NAME. | 1026 "Retrieve the snapshot called NAME. |
1025 This function fails if any files are locked at or below the current directory | 1027 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 |
1039 ;;;###autoload | 1043 ;;;###autoload |
1040 (defun vc-print-log () | 1044 (defun vc-print-log () |