[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc.el,v

From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/vc.el,v
Date: Fri, 20 Oct 2006 07:58:13 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        06/10/20 07:58:12

Index: vc.el
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.422
retrieving revision 1.423
diff -u -b -r1.422 -r1.423
--- vc.el       11 Jul 2006 18:39:31 -0000      1.422
+++ vc.el       20 Oct 2006 07:58:11 -0000      1.423
@@ -2682,6 +2682,8 @@
         (error "There is no version-controlled file in this buffer"))
     (let ((backend (vc-backend buffer-file-name))
          (backends nil))
+      (unwind-protect
+         (progn
       (unless backend
         (error "File %s is not under version control" buffer-file-name))
       ;; Find the registered backends.
@@ -2689,7 +2691,8 @@
        (when (vc-call-backend backend 'registered buffer-file-name)
          (push backend backends)))
       ;; Find the next backend.
-      (let ((def (car (delq backend (append (memq backend backends) 
+           (let ((def (car (delq backend
+                                 (append (memq backend backends) backends))))
            (others (delete backend backends)))
         ((null others) (error "No other backend to switch to"))
@@ -2700,7 +2703,11 @@
             (format "Switch to backend [%s]: " def)
             (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends)
             nil t nil nil (downcase (symbol-name def))))))
-       (t def))))))
+              (t def))))
+       ;; Calling the `registered' method can mess up the file
+       ;; properties, so we want to revert them to what they were.
+       (if (and backend (delete backend backends))
+           (vc-call-backend backend 'registered buffer-file-name))))))
   (unless (eq backend (vc-backend file))
     (vc-file-clearprops file)
     (vc-file-setprop file 'vc-backend backend)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]