summaryrefslogtreecommitdiff
path: root/lisp/vc-rcs.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-10-01 19:35:24 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-10-01 19:35:24 +0000
commit7849e1791b45b99565a0d828bff0dac686c0e230 (patch)
treed23d5e9cbe0f96e93d0f5f9eb287b92168ae4fb0 /lisp/vc-rcs.el
parent65f75351d3c0ef70e108c967a34750b68856fecf (diff)
downloademacs-7849e1791b45b99565a0d828bff0dac686c0e230.tar.gz
* vc.el (vc-editable-p): Minor optimization.
(edit-vc-file, vc-next-action-on-file): Don't use find-file. (vc-find-new-backend): New function split from vc-responsible-backend. (vc-register): Use it. (vc-responsible-backend): Remove REGISTER arg and add BACKENDS arg. (vc-unregister): Drop BACKEND arg (it doesn't work anyway). (vc-default-unregister, vc-revert-buffer): Docstring fix. (vc-clear-headers): Don't use find-file. (vc-revert-buffer): Use `and' again (must have been a braino). (vc-switch-backend): Only prompt if requested. (vc-default-receive-file): Update call to vc-unregister. * vc-rcs.el (vc-rcs-unregister): Keep a backup of the master file. (vc-rcs-receive-file): Avoid with-vc-properties. Update call to vc-unregister. Use constant `RCS' rather than (dynamically bound) var `backend'.
Diffstat (limited to 'lisp/vc-rcs.el')
-rw-r--r--lisp/vc-rcs.el28
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el
index 167e462ccf8..34dbb927c6a 100644
--- a/lisp/vc-rcs.el
+++ b/lisp/vc-rcs.el
@@ -5,7 +5,7 @@
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
-;; $Id: vc-rcs.el,v 1.7 2000/09/22 11:57:30 gerd Exp $
+;; $Id: vc-rcs.el,v 1.8 2000/10/01 11:17:42 spiegel Exp $
;; This file is part of GNU Emacs.
@@ -29,7 +29,7 @@
;;; Code:
(eval-when-compile
- (require 'vc)) ;for macros defined there
+ (require 'cl))
(defcustom vc-rcs-release nil
"*The release number of your RCS installation, as a string.
@@ -716,8 +716,12 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
If this leaves the RCS subdirectory empty, ask the user
whether to remove it."
(let* ((master (vc-name file))
- (dir (file-name-directory master)))
- (delete-file master)
+ (dir (file-name-directory master))
+ (backup-info (find-backup-file-name master)))
+ (if (not backup-info)
+ (delete-file master)
+ (rename-file master (car backup-info) 'ok-if-already-exists)
+ (dolist (f (cdr backup-info)) (ignore-errors (delete-file f))))
(and (string= (file-name-nondirectory (directory-file-name dir)) "RCS")
;; check whether RCS dir is empty, i.e. it does not
;; contain any files except "." and ".."
@@ -733,22 +737,20 @@ whether to remove it."
(state (vc-state file))
(checkout-model (vc-checkout-model file))
(comment (and move (vc-call comment-history file))))
- (if move (vc-unregister file old-backend))
+ (if move (vc-unregister file))
(vc-file-clearprops file)
(if (not (vc-rcs-registered file))
(progn
- (with-vc-properties
- file
- ;; TODO: If the file was 'edited under the old backend,
- ;; this should actually register the version
- ;; it was based on.
- (vc-rcs-register file rev "")
- `((vc-backend ,backend)))
+ ;; TODO: If the file was 'edited under the old backend,
+ ;; this should actually register the version
+ ;; it was based on.
+ (vc-rcs-register file rev "")
+ (vc-file-setprop file 'vc-backend 'RCS)
(if (eq checkout-model 'implicit)
(vc-rcs-set-non-strict-locking file))
(if (not move)
(vc-do-command nil 0 "rcs" file (concat "-b" rev ".1"))))
- (vc-file-setprop file 'vc-backend backend)
+ (vc-file-setprop file 'vc-backend 'RCS)
(vc-file-setprop file 'vc-state 'edited)
(set-file-modes file
(logior (file-modes file) 128)))