summaryrefslogtreecommitdiff
path: root/lisp/vc.el
diff options
context:
space:
mode:
authorAndré Spiegel <spiegel@gnu.org>1995-08-21 19:27:05 +0000
committerAndré Spiegel <spiegel@gnu.org>1995-08-21 19:27:05 +0000
commit8e7eda1a737d2af5703eff40bf2fd63975e16b85 (patch)
tree9df2bd542c4354a8f574a8435db5da2bc2da9870 /lisp/vc.el
parente66eac08b5d8657328f5d07053686964362507c9 (diff)
downloademacs-8e7eda1a737d2af5703eff40bf2fd63975e16b85.tar.gz
(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.
Diffstat (limited to 'lisp/vc.el')
-rw-r--r--lisp/vc.el32
1 files 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