aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel2002-02-21 21:00:35 +0000
committerAndré Spiegel2002-02-21 21:00:35 +0000
commitb470cb6584821a5323d8548eb1462bc2a21af0fa (patch)
tree5f9a38b4062eff1114e0c769b81adfc9f2bee822
parent060a1456cee6bbd23778c3428c9fe61dcb500fb4 (diff)
downloademacs-b470cb6584821a5323d8548eb1462bc2a21af0fa.tar.gz
emacs-b470cb6584821a5323d8548eb1462bc2a21af0fa.zip
Patch by Jonathan Kamens <jik@kamens.brookline.ma.us>.
(vc-default-init-version): Update documentation to indicate that the backend can override the default init version. (vc-register): Use the backend init-version function, if it exists, to determine the initial version of a file. (vc-diff-switches-list): Don't symbol-quote backend, since it's already a symbol. Don't fail if vc-BACKEND-diff-switches isn't bound.
-rw-r--r--lisp/vc.el27
1 files changed, 20 insertions, 7 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 41124f05789..a2ac1ee7208 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -6,7 +6,7 @@
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7;; Keywords: tools 7;; Keywords: tools
8 8
9;; $Id: vc.el,v 1.324 2001/12/20 18:47:19 pj Exp $ 9;; $Id: vc.el,v 1.325 2002/01/05 17:15:20 spiegel Exp $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -171,6 +171,12 @@
171;; The implementation should pass the value of vc-register-switches 171;; The implementation should pass the value of vc-register-switches
172;; to the backend command. 172;; to the backend command.
173;; 173;;
174;; - init-version (file)
175;;
176;; The initial version to use when registering FILE if one is not
177;; specified by the user. If not provided, the variable
178;; vc-default-init-version is used instead.
179;;
174;; - responsible-p (file) 180;; - responsible-p (file)
175;; 181;;
176;; Return non-nil if this backend considers itself "responsible" for 182;; Return non-nil if this backend considers itself "responsible" for
@@ -429,7 +435,8 @@ preserve the setting."
429 435
430(defcustom vc-default-init-version "1.1" 436(defcustom vc-default-init-version "1.1"
431 "*A string used as the default version number when a new file is registered. 437 "*A string used as the default version number when a new file is registered.
432This can be overridden by giving a prefix argument to \\[vc-register]." 438This can be overridden by giving a prefix argument to \\[vc-register]. This
439can also be overridden by a particular VC backend."
433 :type 'string 440 :type 'string
434 :group 'vc 441 :group 'vc
435 :version "20.3") 442 :version "20.3")
@@ -1342,8 +1349,10 @@ first backend that could register the file is used."
1342 (if set-version 1349 (if set-version
1343 (read-string (format "Initial version level for %s: " 1350 (read-string (format "Initial version level for %s: "
1344 (buffer-name))) 1351 (buffer-name)))
1345 ;; TODO: Use backend-specific init version. 1352 (let ((backend (vc-responsible-backend buffer-file-name)))
1346 vc-default-init-version) 1353 (if (vc-find-backend-function backend 'init-version)
1354 (vc-call-backend backend 'init-version)
1355 vc-default-init-version)))
1347 (or comment (not vc-initial-comment)) 1356 (or comment (not vc-initial-comment))
1348 nil 1357 nil
1349 "Enter initial comment." 1358 "Enter initial comment."
@@ -1867,9 +1876,13 @@ actually call the backend, but performs a local diff."
1867 `(append 1876 `(append
1868 (if (listp diff-switches) diff-switches (list diff-switches)) 1877 (if (listp diff-switches) diff-switches (list diff-switches))
1869 (if (listp vc-diff-switches) vc-diff-switches (list vc-diff-switches)) 1878 (if (listp vc-diff-switches) vc-diff-switches (list vc-diff-switches))
1870 (let ((backend-switches 1879 (let* ((backend-switches-symbol
1871 (eval (intern (concat "vc-" (symbol-name ',backend) 1880 (intern (concat "vc-" (symbol-name ,backend)
1872 "-diff-switches"))))) 1881 "-diff-switches")))
1882 (backend-switches
1883 (if (boundp backend-switches-symbol)
1884 (eval backend-switches-symbol)
1885 nil)))
1873 (if (listp backend-switches) backend-switches (list backend-switches))))) 1886 (if (listp backend-switches) backend-switches (list backend-switches)))))
1874 1887
1875(defun vc-default-diff-tree (backend dir rel1 rel2) 1888(defun vc-default-diff-tree (backend dir rel1 rel2)