aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-05-18 07:53:08 +0000
committerDan Nicolaescu2008-05-18 07:53:08 +0000
commit30cd7dc2bcd13325ed370101cbc7a1387fdbf4f0 (patch)
tree315eedd9cd93bdf993e43caf609cd6c68ef6696a
parentd002d68fdcceface95296f4966f89cf14de9f8fe (diff)
downloademacs-30cd7dc2bcd13325ed370101cbc7a1387fdbf4f0.tar.gz
emacs-30cd7dc2bcd13325ed370101cbc7a1387fdbf4f0.zip
(Todo): Add known problems.
(vc-dir-backend): New variable. (vc-dir): Set it. (vc-make-backend-object, vc-generic-status-printer) (vc-generic-state, vc-generic-status-fileinfo-extra) (vc-dir-extra-menu): Use it. (vc-generic-dir-headers): Remove, unused.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/vc.el52
2 files changed, 43 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 20174ceeec1..0329e2273d7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,13 @@
12008-05-18 Dan Nicolaescu <dann@ics.uci.edu> 12008-05-18 Dan Nicolaescu <dann@ics.uci.edu>
2 2
3 * vc.el (Todo): Add known problems.
4 (vc-dir-backend): New variable.
5 (vc-dir): Set it.
6 (vc-make-backend-object, vc-generic-status-printer)
7 (vc-generic-state, vc-generic-status-fileinfo-extra)
8 (vc-dir-extra-menu): Use it.
9 (vc-generic-dir-headers): Remove, unused.
10
3 * vc-dispatcher.el (vc-dir-previous-directory): Rename from 11 * vc-dispatcher.el (vc-dir-previous-directory): Rename from
4 vc-dir-prev-directory for consistency with vc-dir-previous-line. 12 vc-dir-prev-directory for consistency with vc-dir-previous-line.
5 (vc-dir-mode-map): Fix bindings. 13 (vc-dir-mode-map): Fix bindings.
diff --git a/lisp/vc.el b/lisp/vc.el
index c973cf7057d..7cf24bcd953 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -609,6 +609,9 @@
609;; the two branches. Or you locally add file FOO and then pull a 609;; the two branches. Or you locally add file FOO and then pull a
610;; change that also adds a new file FOO, ... 610;; change that also adds a new file FOO, ...
611;; 611;;
612;; - C-x v l should insert the file set in the *VC-log* buffer so that
613;; log-view can recognize it and use it for its commands.
614;;
612;; - vc-diff should be able to show the diff for all files in a 615;; - vc-diff should be able to show the diff for all files in a
613;; changeset, especially for VC systems that have per repository 616;; changeset, especially for VC systems that have per repository
614;; version numbers. log-view should take advantage of this. 617;; version numbers. log-view should take advantage of this.
@@ -641,7 +644,25 @@
641;; Those logs should likely use a local variable to hardware the VC they 644;; Those logs should likely use a local variable to hardware the VC they
642;; are supposed to work with. 645;; are supposed to work with.
643;; 646;;
644 647;;;; Problems:
648;;
649;; - log-view-diff does not work anymore in the case when the log was
650;; created from more than one file. The error is:
651;; vc-derived-from-dir-mode: Lisp nesting exceeds `max-lisp-eval-depth'.
652;;
653;; - the vc-dir display is now bogus for git and mercurial.
654;;
655;; - the CVS vc-dir display is now incorrect from some states.
656;;
657;; - vc-dir is now broken for RCS and SCCS.
658;;
659;; - the *vc-dir* buffer is not updated correctly anymore after VC
660;; operations that change the file state.
661;;
662;; - the mouse3 menu for vc-dir does not have a title anymore.
663;;
664;; - the menu for the *vc-dir* buffer uses the wrong name now.
665;;
645;;; Code: 666;;; Code:
646 667
647(require 'vc-hooks) 668(require 'vc-hooks)
@@ -990,6 +1011,8 @@ the common state of the fileset. Return (BACKEND . FILESET)."
990 (cooked (cdr selection)) ;; Files only 1011 (cooked (cdr selection)) ;; Files only
991 ;; FIXME: Store the backend in a buffer-local variable. 1012 ;; FIXME: Store the backend in a buffer-local variable.
992 (backend (if (vc-derived-from-dir-mode (current-buffer)) 1013 (backend (if (vc-derived-from-dir-mode (current-buffer))
1014 ;; FIXME: this should use vc-dir-backend from
1015 ;; the *vc-dir* buffer.
993 (vc-responsible-backend default-directory) 1016 (vc-responsible-backend default-directory)
994 (assert (and (= 1 (length raw)) 1017 (assert (and (= 1 (length raw))
995 (not (file-directory-p (car raw))))) 1018 (not (file-directory-p (car raw)))))
@@ -1941,34 +1964,28 @@ outside of VC) and one wants to do some operation on it."
1941 "Default absence of extra information returned for a file." 1964 "Default absence of extra information returned for a file."
1942 nil) 1965 nil)
1943 1966
1967(defvar vc-dir-backend nil
1968 "The backend used by the current *vc-dir* buffer.")
1969
1944;; FIXME: Replace these with a more efficient dispatch 1970;; FIXME: Replace these with a more efficient dispatch
1945 1971
1946(defun vc-generic-status-printer (fileentry) 1972(defun vc-generic-status-printer (fileentry)
1947 (let* ((file (vc-dir-fileinfo->name fileentry)) 1973 (vc-call-backend vc-dir-backend 'status-printer fileentry))
1948 (backend (vc-responsible-backend (expand-file-name file)))) 1974
1949 (vc-call-backend backend 'status-printer fileentry)))
1950
1951(defun vc-generic-state (file) 1975(defun vc-generic-state (file)
1952 (let ((backend (vc-responsible-backend (expand-file-name file)))) 1976 (vc-call-backend vc-dir-backend 'state file))
1953 (vc-call-backend backend 'state file)))
1954
1955(defun vc-generic-status-fileinfo-extra (file)
1956 (let ((backend (vc-responsible-backend (expand-file-name file))))
1957 (vc-call-backend backend 'status-fileinfo-extra file)))
1958 1977
1959(defun vc-generic-dir-headers (dir) 1978(defun vc-generic-status-fileinfo-extra (file)
1960 (let ((backend (vc-responsible-backend dir))) 1979 (vc-call-backend vc-dir-backend 'status-fileinfo-extra file))
1961 (vc-dir-headers backend dir)))
1962 1980
1963(defun vc-dir-extra-menu () 1981(defun vc-dir-extra-menu ()
1964 (vc-call-backend (vc-responsible-backend default-directory) 'extra-status-menu)) 1982 (vc-call-backend vc-dir-backend 'extra-status-menu))
1965 1983
1966(defun vc-make-backend-object (file-or-dir) 1984(defun vc-make-backend-object (file-or-dir)
1967 "Create the backend capability object needed by vc-dispatcher." 1985 "Create the backend capability object needed by vc-dispatcher."
1968 (vc-create-client-object 1986 (vc-create-client-object
1969 "VC status" 1987 "VC status"
1970 (let ((backend (vc-responsible-backend file-or-dir))) 1988 (vc-dir-headers vc-dir-backend file-or-dir)
1971 (vc-dir-headers backend file-or-dir))
1972 #'vc-generic-status-printer 1989 #'vc-generic-status-printer
1973 #'vc-generic-state 1990 #'vc-generic-state
1974 #'vc-generic-status-fileinfo-extra 1991 #'vc-generic-status-fileinfo-extra
@@ -1984,6 +2001,7 @@ outside of VC) and one wants to do some operation on it."
1984 (vc-dir-refresh) 2001 (vc-dir-refresh)
1985 ;; Otherwise, initialize a new view using the dispatcher layer 2002 ;; Otherwise, initialize a new view using the dispatcher layer
1986 (progn 2003 (progn
2004 (set (make-local-variable 'vc-dir-backend) (vc-responsible-backend dir))
1987 ;; Build a capability object and hand it to the dispatcher initializer 2005 ;; Build a capability object and hand it to the dispatcher initializer
1988 (vc-dir-mode (vc-make-backend-object dir)) 2006 (vc-dir-mode (vc-make-backend-object dir))
1989 ;; FIXME: Make a derived-mode instead. 2007 ;; FIXME: Make a derived-mode instead.