aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-10-01 20:58:17 +0000
committerStefan Monnier2000-10-01 20:58:17 +0000
commitceec5a0c1b94e1b5cda93874292b29a1fa5f4a7b (patch)
tree82b7e49b075784435de023f1eea92cb4bceb6d48
parent7849e1791b45b99565a0d828bff0dac686c0e230 (diff)
downloademacs-ceec5a0c1b94e1b5cda93874292b29a1fa5f4a7b.tar.gz
emacs-ceec5a0c1b94e1b5cda93874292b29a1fa5f4a7b.zip
(with-vc-file, vc-next-action-on-file):
Use vc-backend rather than vc-registered. (vc-next-action-on-file): Use intern-soft. Deal with read-only *vc-diff* buffer. (vc-switch-backend): Short circuit if nothing is to be done. Handle the case where (not (memq backend backends)). Don't use vc-resynch-buffer which could lose unsaved editing. (vc-transfer-file): Docstring fix.
-rw-r--r--lisp/ChangeLog26
-rw-r--r--lisp/vc.el34
2 files changed, 45 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e13d8a79869..a2be1fe69f9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,29 @@
12000-10-01 Stefan Monnier <monnier@cs.yale.edu>
2
3 * vc.el (vc-editable-p): Minor optimization.
4 (edit-vc-file, vc-next-action-on-file): Don't use find-file.
5 (vc-find-new-backend): New function split from vc-responsible-backend.
6 (vc-register): Use it.
7 (vc-responsible-backend): Remove REGISTER arg and add BACKENDS arg.
8 (vc-unregister): Drop BACKEND arg (it doesn't work anyway).
9 (vc-default-unregister, vc-revert-buffer): Docstring fix.
10 (vc-clear-headers): Don't use find-file.
11 (vc-revert-buffer): Use `and' again (must have been a braino).
12 (vc-switch-backend): Only prompt if requested.
13 Short circuit if nothing is to be done.
14 Don't use vc-resynch-buffer which could lose unsaved editing.
15 (vc-default-receive-file): Update call to vc-unregister.
16 (with-vc-file, vc-next-action-on-file):
17 Use vc-backend rather than vc-registered.
18 (vc-next-action-on-file): Use intern-soft.
19 Deal with read-only *vc-diff* buffer.
20 (vc-transfer-file): Docstring fix.
21
22 * vc-rcs.el (vc-rcs-unregister): Keep a backup of the master file.
23 (vc-rcs-receive-file): Avoid with-vc-properties.
24 Update call to vc-unregister.
25 Use constant `RCS' rather than (dynamically bound) var `backend'.
26
12000-10-01 Andre Spiegel <spiegel@gnu.org> 272000-10-01 Andre Spiegel <spiegel@gnu.org>
2 28
3 * vc.el (vc-next-action-on-file): Update mode line only if file 29 * vc.el (vc-next-action-on-file): Update mode line only if file
diff --git a/lisp/vc.el b/lisp/vc.el
index 661757c89e9..87a92e0d681 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -504,7 +504,7 @@ FILE is passed through `expand-file-name'; BODY executed within
504`save-excursion'. If FILE is not under version control, or locked by 504`save-excursion'. If FILE is not under version control, or locked by
505somebody else, signal error." 505somebody else, signal error."
506 `(let ((file (expand-file-name ,file))) 506 `(let ((file (expand-file-name ,file)))
507 (or (vc-registered file) 507 (or (vc-backend file)
508 (error (format "File not under version control: `%s'" file))) 508 (error (format "File not under version control: `%s'" file)))
509 (unless (vc-editable-p file) 509 (unless (vc-editable-p file)
510 (let ((state (vc-state file))) 510 (let ((state (vc-state file)))
@@ -833,7 +833,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
833 (error "Aborted"))))) 833 (error "Aborted")))))
834 834
835 ;; Do the right thing 835 ;; Do the right thing
836 (if (not (vc-registered file)) 836 (if (not (vc-backend file))
837 (vc-register verbose comment) 837 (vc-register verbose comment)
838 (vc-recompute-state file) 838 (vc-recompute-state file)
839 (if visited (vc-mode-line file)) 839 (if visited (vc-mode-line file))
@@ -845,12 +845,12 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
845 (cond 845 (cond
846 (verbose 846 (verbose
847 ;; go to a different version 847 ;; go to a different version
848 (setq version 848 (setq version
849 (read-string "Branch, version, or backend to move to: ")) 849 (read-string "Branch, version, or backend to move to: "))
850 (let ((vsym (intern (upcase version)))) 850 (let ((vsym (intern-soft (upcase version))))
851 (if (member vsym vc-handled-backends) 851 (if (member vsym vc-handled-backends)
852 (vc-transfer-file file vsym) 852 (vc-transfer-file file vsym)
853 (vc-checkout file (eq (vc-checkout-model file) 'implicit) 853 (vc-checkout file (eq (vc-checkout-model file) 'implicit)
854 version)))) 854 version))))
855 ((not (eq (vc-checkout-model file) 'implicit)) 855 ((not (eq (vc-checkout-model file) 'implicit))
856 ;; check the file out 856 ;; check the file out
@@ -928,8 +928,9 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
928 (if (save-window-excursion 928 (if (save-window-excursion
929 (vc-version-diff file (vc-workfile-version file) nil) 929 (vc-version-diff file (vc-workfile-version file) nil)
930 (goto-char (point-min)) 930 (goto-char (point-min))
931 (insert-string (format "Changes to %s since last lock:\n\n" 931 (let ((inhibit-read-only t))
932 file)) 932 (insert-string
933 (format "Changes to %s since last lock:\n\n" file)))
933 (not (beep)) 934 (not (beep))
934 (yes-or-no-p (concat "File has unlocked changes. " 935 (yes-or-no-p (concat "File has unlocked changes. "
935 "Claim lock retaining changes? "))) 936 "Claim lock retaining changes? ")))
@@ -2240,7 +2241,7 @@ To get a prompt, use a prefix argument."
2240 (when (vc-call-backend backend 'registered buffer-file-name) 2241 (when (vc-call-backend backend 'registered buffer-file-name)
2241 (push backend backends))) 2242 (push backend backends)))
2242 ;; Find the next backend. 2243 ;; Find the next backend.
2243 (let ((def (car (delq backend (memq backend (append backends backends))))) 2244 (let ((def (car (delq backend (append (memq backend backends) backends))))
2244 (others (delete backend backends))) 2245 (others (delete backend backends)))
2245 (cond 2246 (cond
2246 ((null others) (error "No other backend to switch to")) 2247 ((null others) (error "No other backend to switch to"))
@@ -2252,17 +2253,20 @@ To get a prompt, use a prefix argument."
2252 (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends) 2253 (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends)
2253 nil t nil nil (downcase (symbol-name def)))))) 2254 nil t nil nil (downcase (symbol-name def))))))
2254 (t def)))))) 2255 (t def))))))
2255 (unless (vc-call-backend backend 'registered file) 2256 (unless (eq backend (vc-backend file))
2256 (error "%s is not registered in %s" file backend)) 2257 (unless (vc-call-backend backend 'registered file)
2257 (vc-file-clearprops file) 2258 (error "%s is not registered in %s" file backend))
2258 (vc-file-setprop file 'vc-backend backend) 2259 (vc-file-clearprops file)
2259 (vc-resynch-buffer file t t)) 2260 (vc-file-setprop file 'vc-backend backend)
2261 ;; Force recomputation of the state
2262 (vc-call-backend backend 'registered file)
2263 (vc-mode-line file)))
2260 2264
2261;;;autoload 2265;;;autoload
2262(defun vc-transfer-file (file new-backend) 2266(defun vc-transfer-file (file new-backend)
2263 "Transfer FILE to another version control system NEW-BACKEND. 2267 "Transfer FILE to another version control system NEW-BACKEND.
2264If NEW-BACKEND has a higher precedence than FILE's current backend 2268If NEW-BACKEND has a higher precedence than FILE's current backend
2265\(i.e. it comes earlier in vc-handled-backends), then register FILE in 2269\(i.e. it comes earlier in `vc-handled-backends'), then register FILE in
2266NEW-BACKEND, using the version number from the current backend as the 2270NEW-BACKEND, using the version number from the current backend as the
2267base level. If NEW-BACKEND has a lower precedence than the current 2271base level. If NEW-BACKEND has a lower precedence than the current
2268backend, then commit all changes that were made under the current 2272backend, then commit all changes that were made under the current