comparison lisp/vc.el @ 90645:7eeafaaa9eab

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 476-489) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 153-160) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-127
author Miles Bader <miles@gnu.org>
date Mon, 30 Oct 2006 08:54:41 +0000
parents 8a8e69664178 59e895845146
children 95d0cdf160ea
comparison
equal deleted inserted replaced
90644:9b62e05dedf6 90645:7eeafaaa9eab
2680 (list 2680 (list
2681 (or buffer-file-name 2681 (or buffer-file-name
2682 (error "There is no version-controlled file in this buffer")) 2682 (error "There is no version-controlled file in this buffer"))
2683 (let ((backend (vc-backend buffer-file-name)) 2683 (let ((backend (vc-backend buffer-file-name))
2684 (backends nil)) 2684 (backends nil))
2685 (unless backend 2685 (unwind-protect
2686 (error "File %s is not under version control" buffer-file-name)) 2686 (progn
2687 ;; Find the registered backends. 2687 (unless backend
2688 (dolist (backend vc-handled-backends) 2688 (error "File %s is not under version control" buffer-file-name))
2689 (when (vc-call-backend backend 'registered buffer-file-name) 2689 ;; Find the registered backends.
2690 (push backend backends))) 2690 (dolist (backend vc-handled-backends)
2691 ;; Find the next backend. 2691 (when (vc-call-backend backend 'registered buffer-file-name)
2692 (let ((def (car (delq backend (append (memq backend backends) backends)))) 2692 (push backend backends)))
2693 (others (delete backend backends))) 2693 ;; Find the next backend.
2694 (cond 2694 (let ((def (car (delq backend
2695 ((null others) (error "No other backend to switch to")) 2695 (append (memq backend backends) backends))))
2696 (current-prefix-arg 2696 (others (delete backend backends)))
2697 (intern 2697 (cond
2698 (upcase 2698 ((null others) (error "No other backend to switch to"))
2699 (completing-read 2699 (current-prefix-arg
2700 (format "Switch to backend [%s]: " def) 2700 (intern
2701 (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends) 2701 (upcase
2702 nil t nil nil (downcase (symbol-name def)))))) 2702 (completing-read
2703 (t def)))))) 2703 (format "Switch to backend [%s]: " def)
2704 (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends)
2705 nil t nil nil (downcase (symbol-name def))))))
2706 (t def))))
2707 ;; Calling the `registered' method can mess up the file
2708 ;; properties, so we want to revert them to what they were.
2709 (if (and backend (delete backend backends))
2710 (vc-call-backend backend 'registered buffer-file-name))))))
2704 (unless (eq backend (vc-backend file)) 2711 (unless (eq backend (vc-backend file))
2705 (vc-file-clearprops file) 2712 (vc-file-clearprops file)
2706 (vc-file-setprop file 'vc-backend backend) 2713 (vc-file-setprop file 'vc-backend backend)
2707 ;; Force recomputation of the state 2714 ;; Force recomputation of the state
2708 (unless (vc-call-backend backend 'registered file) 2715 (unless (vc-call-backend backend 'registered file)