aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel2000-10-22 15:37:51 +0000
committerAndré Spiegel2000-10-22 15:37:51 +0000
commit10b48cc413c837e8b48a8861c4b2b4294d27c95a (patch)
tree2eb3979d0686764d79e66db856b2e03621441b4f
parentc86ef81ce6dbcba80696e545e6fb9fb8f062844e (diff)
downloademacs-10b48cc413c837e8b48a8861c4b2b4294d27c95a.tar.gz
emacs-10b48cc413c837e8b48a8861c4b2b4294d27c95a.zip
(vc-checkout): Added `-p' suffix in call to vc-make-version-backups-p;
use vc-make-version-backup to actually make the backup. (vc-version-other-window, vc-version-backup-file): Handle both automatic and manual backups. (vc-revert-file): Use vc-delete-automatic-version-backups to get rid of all of them.
-rw-r--r--lisp/vc.el30
1 files changed, 18 insertions, 12 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 6705ab89182..3229ae9864e 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see below for full credits) 5;; Author: FSF (see below for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc.el,v 1.279 2000/10/08 19:12:52 monnier Exp $ 8;; $Id: vc.el,v 1.280 2000/10/10 01:25:40 ttn Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -1212,10 +1212,9 @@ If WRITABLE is non-nil, make sure the retrieved file is writable.
1212REV defaults to the latest revision." 1212REV defaults to the latest revision."
1213 (and writable 1213 (and writable
1214 (not rev) 1214 (not rev)
1215 (vc-call make-version-backups file) 1215 (vc-call make-version-backups-p file)
1216 (vc-up-to-date-p file) 1216 (vc-up-to-date-p file)
1217 (copy-file file (vc-version-backup-file-name file) 1217 (vc-make-version-backup file))
1218 'ok-if-already-exists 'keep-date))
1219 (with-vc-properties 1218 (with-vc-properties
1220 file 1219 file
1221 (condition-case err 1220 (condition-case err
@@ -1574,10 +1573,13 @@ If `F.~REV~' already exists, it is used instead of being re-created."
1574 (let* ((version (if (string-equal rev "") 1573 (let* ((version (if (string-equal rev "")
1575 (vc-workfile-version buffer-file-name) 1574 (vc-workfile-version buffer-file-name)
1576 rev)) 1575 rev))
1577 (filename (concat buffer-file-name ".~" version "~"))) 1576 (automatic-backup (vc-version-backup-file-name file version))
1578 (or (file-exists-p filename) 1577 (manual-backup (vc-version-backup-file-name file version 'manual)))
1579 (vc-call checkout buffer-file-name nil version filename)) 1578 (unless (file-exists-p manual-backup)
1580 (find-file-other-window filename))) 1579 (if (file-exists-p automatic-backup)
1580 (copy-file automatic-backup manual-backup nil 'keep-date)
1581 (vc-call checkout buffer-file-name nil version manual-backup)))
1582 (find-file-other-window manual-backup)))
1581 1583
1582;; Header-insertion code 1584;; Header-insertion code
1583 1585
@@ -2212,10 +2214,14 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action]
2212 "If version backups should be used for FILE, and there exists 2214 "If version backups should be used for FILE, and there exists
2213such a backup for REV or the current workfile version of file, 2215such a backup for REV or the current workfile version of file,
2214return the name of it; otherwise return nil." 2216return the name of it; otherwise return nil."
2215 (when (vc-call make-version-backups file) 2217 (when (vc-call make-version-backups-p file)
2216 (let ((backup-file (vc-version-backup-file-name file rev))) 2218 (let ((backup-file (vc-version-backup-file-name file rev)))
2217 (and (file-exists-p backup-file) 2219 (if (file-exists-p backup-file)
2218 backup-file)))) 2220 backup-file
2221 ;; there is no automatic backup, but maybe the user made one manually
2222 (setq backup-file (vc-version-backup-file-name file rev 'manual))
2223 (if (file-exists-p backup-file)
2224 backup-file)))))
2219 2225
2220(defun vc-revert-file (file) 2226(defun vc-revert-file (file)
2221 "Revert FILE back to the version it was based on." 2227 "Revert FILE back to the version it was based on."
@@ -2225,7 +2231,7 @@ return the name of it; otherwise return nil."
2225 (if (not backup-file) 2231 (if (not backup-file)
2226 (vc-call revert file) 2232 (vc-call revert file)
2227 (copy-file backup-file file 'ok-if-already-exists 'keep-date) 2233 (copy-file backup-file file 'ok-if-already-exists 'keep-date)
2228 (delete-file backup-file))) 2234 (vc-delete-automatic-version-backups file)))
2229 `((vc-state . up-to-date) 2235 `((vc-state . up-to-date)
2230 (vc-checkout-time . ,(nth 5 (file-attributes file))))) 2236 (vc-checkout-time . ,(nth 5 (file-attributes file)))))
2231 (vc-resynch-buffer file t t)) 2237 (vc-resynch-buffer file t t))