From 8e7eda1a737d2af5703eff40bf2fd63975e16b85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Spiegel?= Date: Mon, 21 Aug 1995 19:27:05 +0000 Subject: [PATCH] (vc-latest-on-branch-p): Under CVS, handle the case when the file is added, but not yet committed. (vc-backend-checkout): RCS case: In non-strict locking mode, force to overwrite the writable workfile. CVS case: Do the right thing in CVSREAD-mode. --- lisp/vc.el | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lisp/vc.el b/lisp/vc.el index 521b949d32e..cdd6697398f 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -266,7 +266,8 @@ and that its contents match what the master file says.") (kill-buffer (get-buffer "*vc-info*"))) (string= tip-version workfile-version)))) ;; CVS - (string= (vc-workfile-version file) (vc-latest-version file)))) + (or (string= (vc-workfile-version file) "0") ;; added but not committed. + (string= (vc-workfile-version file) (vc-latest-version file))))) (defun vc-registration-error (file) (if file @@ -1710,6 +1711,9 @@ From a program, any arguments are passed to the `rcs2log' script." ;; now do the checkout (apply 'vc-do-command nil 0 "co" file 'MASTER + ;; If locking is not strict, force to overwrite + ;; the writable workfile. + (if (eq (vc-checkout-model file) 'implicit) "-f") (if writable "-l") (if rev (concat "-r" rev) ;; if no explicit revision was specified, @@ -1751,14 +1755,21 @@ From a program, any arguments are passed to the `rcs2log' script." ;; default for verbose checkout: clear the sticky tag ;; so that the actual update will go to the head of the trunk (and rev (string= rev "") - (vc-do-command nil 0 "cvs" file 'WORKFILE "update" "-A") - (setq rev nil)) - (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE - "update" - (and rev (concat "-r" rev)) - vc-checkout-switches) - (vc-file-setprop file 'vc-workfile-version nil)) - )) + (vc-do-command nil 0 "cvs" file 'WORKFILE "update" "-A")) + ;; If a revision was specified, check that out. + (if rev + (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE + (and writable (eq (vc-checkout-model file) 'manual) "-w") + "update" + (and rev (not (string= rev "")) + (concat "-r" rev)) + vc-checkout-switches) + ;; If no revision was specified, simply make the file writable. + (and writable + (or (eq (vc-checkout-model file) 'manual) + (zerop (logand 128 (file-modes file)))) + (set-file-modes file (logior 128 (file-modes file))))) + (if rev (vc-file-setprop file 'vc-workfile-version nil)))) (setq default-directory old-default-dir) (cond ((not workfile) @@ -1767,8 +1778,7 @@ From a program, any arguments are passed to the `rcs2log' script." (vc-file-setprop file 'vc-locking-user (user-login-name))) (vc-file-setprop file 'vc-checkout-time (nth 5 (file-attributes file))))) - (message "Checking out %s...done" filename)) - ) + (message "Checking out %s...done" filename)))) (defun vc-backend-logentry-check (file) (vc-backend-dispatch file -- 2.39.2