changeset 96123:7742c3c06407

* vc.el (vc-switch-backend): Simplify. (Todo): Remove solved items. * vc-cvs.el (vc-cvs-parse-status, vc-cvs-parse-entry): Do not set the vc-backend property.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 20 Jun 2008 17:08:55 +0000
parents 147721a08602
children 48b2db6b4c28
files lisp/ChangeLog lisp/vc-cvs.el lisp/vc.el
diffstat 3 files changed, 14 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jun 20 17:05:55 2008 +0000
+++ b/lisp/ChangeLog	Fri Jun 20 17:08:55 2008 +0000
@@ -1,6 +1,11 @@
 2008-06-20  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc.el (vc-dir-hide-up-to-date): Undo previous change.
+	(vc-switch-backend): Simplify.
+	(Todo): Remove solved items.
+	
+	* vc-cvs.el (vc-cvs-parse-status, vc-cvs-parse-entry): Do not set
+	the vc-backend property.
 
 2008-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
--- a/lisp/vc-cvs.el	Fri Jun 20 17:05:55 2008 +0000
+++ b/lisp/vc-cvs.el	Fri Jun 20 17:08:55 2008 +0000
@@ -800,7 +800,6 @@
       (cond
        ((re-search-forward "\\=\\([^ \t]+\\)" nil t)
 	(setq file (expand-file-name (match-string 1)))
-	(vc-file-setprop file 'vc-backend 'CVS)
 	(setq status(if (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)
                         (match-string 1) "Unknown"))
 	(when (and full
@@ -1042,7 +1041,6 @@
   (cond
    ;; entry for a "locally added" file (not yet committed)
    ((looking-at "/[^/]+/0/")
-    (vc-file-setprop file 'vc-backend 'CVS)
     (vc-file-setprop file 'vc-checkout-time 0)
     (vc-file-setprop file 'vc-working-revision "0")
     (if set-state (vc-file-setprop file 'vc-state 'added)))
@@ -1058,7 +1056,6 @@
 	     ;; sticky tag
 	     "\\(.\\|\\)" ;Sticky tag type (date or tag name, could be empty)
 	     "\\(.*\\)"))		;Sticky tag
-    (vc-file-setprop file 'vc-backend 'CVS)
     (vc-file-setprop file 'vc-working-revision (match-string 1))
     (vc-file-setprop file 'vc-cvs-sticky-tag
 		     (vc-cvs-parse-sticky-tag (match-string 4)
--- a/lisp/vc.el	Fri Jun 20 17:05:55 2008 +0000
+++ b/lisp/vc.el	Fri Jun 20 17:08:55 2008 +0000
@@ -573,10 +573,6 @@
 ;;   display the branch name in the mode-line. Replace
 ;;   vc-cvs-sticky-tag with that.
 ;;
-;; - C-x v b does switch to a different backend, but the mode line is not
-;;   adapted accordingly.  Also, it considers RCS and CVS to be the same,
-;;   which is pretty confusing.
-;;
 ;; - vc-create-tag and vc-retrieve-tag should update the
 ;;   buffers that might be visiting the affected files.
 ;;
@@ -613,13 +609,6 @@
 ;;   the two branches.  Or you locally add file FOO and then pull a
 ;;   change that also adds a new file FOO, ...
 ;;
-;; - C-x v l should insert the file set in the *VC-log* buffer so that
-;;   log-view can recognize it and use it for its commands.
-;;
-;; - vc-diff should be able to show the diff for all files in a
-;;   changeset, especially for VC systems that have per repository
-;;   version numbers.  log-view should take advantage of this.
-;;
 ;; - make it easier to write logs.  Maybe C-x 4 a should add to the log
 ;;   buffer, if one is present, instead of adding to the ChangeLog.
 ;;
@@ -2359,17 +2348,18 @@
    (list
     (or buffer-file-name
         (error "There is no version-controlled file in this buffer"))
-    (let ((backend (vc-backend buffer-file-name))
+    (let ((crt-bk (vc-backend buffer-file-name))
 	  (backends nil))
-      (unless backend
+      (unless crt-bk
         (error "File %s is not under version control" buffer-file-name))
       ;; Find the registered backends.
-      (dolist (backend vc-handled-backends)
-	(when (vc-call-backend backend 'registered buffer-file-name)
-	  (push backend backends)))
+      (dolist (crt vc-handled-backends)
+	(when (and (vc-call-backend crt 'registered buffer-file-name)
+		   (not (eq crt-bk crt)))
+	  (push crt backends)))
       ;; Find the next backend.
-      (let ((def (car (delq backend (append (memq backend backends) backends))))
-	    (others (delete backend backends)))
+      (let ((def (car backends))
+	    (others backends))
 	(cond
 	 ((null others) (error "No other backend to switch to"))
 	 (current-prefix-arg
@@ -2379,7 +2369,7 @@
 	     (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))))))
   (unless (eq backend (vc-backend file))
     (vc-file-clearprops file)
     (vc-file-setprop file 'vc-backend backend)