Mercurial > emacs
changeset 12561:348341c2d7d1
(vc-mode-line): Don't write-protect a
VC-Log buffer. Better mode line text for initial comments.
Streamlined the function.
(vc-locking-user): Consider a cvs file "locked"
if its status is either 'locally-modified or 'needs-merge.
(vc-workfile-version): Catch 'found when calling vc-find-cvs-master.
(vc-fetch-master-properties): Handle cvs status "Needs Checkout".
This is intended for future use.
(vc-fetch-master-properties): Shrink the window
that displays the error message.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 17 Jul 1995 22:56:28 +0000 |
parents | fc8171b983be |
children | a9b08e50d6ec |
files | lisp/vc-hooks.el |
diffstat | 1 files changed, 21 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/vc-hooks.el Mon Jul 17 22:54:43 1995 +0000 +++ b/lisp/vc-hooks.el Mon Jul 17 22:56:28 1995 +0000 @@ -292,7 +292,8 @@ (list "status" file))) (cond ((> exec-status 0) (switch-to-buffer (get-file-buffer file)) - (display-buffer "*vc-info*") + (shrink-window-if-larger-than-buffer + (display-buffer "*vc-info*")) (error "Couldn't find version control information")))) (set-buffer (get-buffer "*vc-info*")) (set-buffer-modified-p nil) @@ -315,6 +316,8 @@ (vc-file-setprop file 'vc-cvs-status 'locally-modified)) ((string-match "Needs Merge" status) (vc-file-setprop file 'vc-cvs-status 'needs-merge)) + ((string-match "Needs Checkout" status) + (vc-file-setprop file 'vc-cvs-status 'needs-checkout)) (t (vc-file-setprop file 'vc-cvs-status nil)))))) (if (get-buffer "*vc-info*") (kill-buffer (get-buffer "*vc-info*"))))) @@ -490,7 +493,8 @@ (cond ;; in the CVS case, check the status ((eq (vc-backend file) 'CVS) - (if (eq (vc-cvs-status file) 'up-to-date) + (if (and (not (eq (vc-cvs-status file) 'locally-modified)) + (not (eq (vc-cvs-status file) 'needs-merge))) (vc-file-setprop file 'vc-locking-user 'none) ;; The expression below should return the username of the owner ;; of the file. It doesn't. It returns the username if it is @@ -617,8 +621,9 @@ ((eq (vc-backend file) 'CVS) (if (vc-consult-rcs-headers file) ;; CVS (vc-file-getprop file 'vc-workfile-version) - (vc-find-cvs-master (file-name-directory file) - (file-name-nondirectory file)) + (catch 'found + (vc-find-cvs-master (file-name-directory file) + (file-name-nondirectory file))) (vc-file-getprop file 'vc-workfile-version))))) ;;; actual version-control code starts here @@ -724,25 +729,21 @@ visiting FILE. Second optional arg LABEL is put in place of version control system name." (interactive (list buffer-file-name nil)) - (let ((vc-type (vc-backend file)) - (vc-status-string (and vc-display-status (vc-status file)))) + (let ((vc-type (vc-backend file))) (setq vc-mode - (concat " " (or label (symbol-name vc-type)) vc-status-string)) - ;; Make the buffer read-only if the file is not locked - ;; (or unchanged, in the CVS case). - ;; Determine this by looking at the mode string, - ;; so that no further external status query is necessary - (if vc-status-string - (if (eq (elt vc-status-string 0) ?-) - (setq buffer-read-only t)) - (if (not (vc-locking-user file)) - (setq buffer-read-only t))) - ;; Even root shouldn't modify a registered file without - ;; locking it first. - (and vc-type + (and vc-type + (concat " " (or label (symbol-name vc-type)) + (and vc-display-status (vc-status file))))) + (and vc-type + (equal file (buffer-file-name)) + ;; Make the buffer read-only if the file is not locked + ;; (or unchanged, in the CVS case). + (if (not (vc-locking-user file)) + (setq buffer-read-only t)) + ;; Even root shouldn't modify a registered file without + ;; locking it first. (not buffer-read-only) (zerop (user-uid)) - (require 'vc) (not (equal (user-login-name) (vc-locking-user file))) (setq buffer-read-only t)) (and (null vc-type)