Mercurial > emacs
comparison lisp/vc.el @ 43450:2b50b9c69fde
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.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Thu, 21 Feb 2002 21:00:35 +0000 |
parents | 1cf3624d80ac |
children | 143e4daefa5e |
comparison
equal
deleted
inserted
replaced
43449:a6beccc5505e | 43450:2b50b9c69fde |
---|---|
4 | 4 |
5 ;; Author: FSF (see below for full credits) | 5 ;; Author: FSF (see below for full credits) |
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 |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
14 ;; it under the terms of the GNU General Public License as published by | 14 ;; it under the terms of the GNU General Public License as published by |
169 ;; Register FILE in this backend. Optionally, an initial revision REV | 169 ;; Register FILE in this backend. Optionally, an initial revision REV |
170 ;; and an initial description of the file, COMMENT, may be specified. | 170 ;; and an initial description of the file, COMMENT, may be specified. |
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 |
177 ;; FILE, which can also be a directory. This function is used to find | 183 ;; FILE, which can also be a directory. This function is used to find |
178 ;; out what backend to use for registration of new files and for things | 184 ;; out what backend to use for registration of new files and for things |
427 :type 'boolean | 433 :type 'boolean |
428 :group 'vc) | 434 :group 'vc) |
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. |
432 This can be overridden by giving a prefix argument to \\[vc-register]." | 438 This can be overridden by giving a prefix argument to \\[vc-register]. This |
439 can 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") |
436 | 443 |
437 (defcustom vc-command-messages nil | 444 (defcustom vc-command-messages nil |
1340 | 1347 |
1341 (vc-start-entry buffer-file-name | 1348 (vc-start-entry buffer-file-name |
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." |
1350 (lambda (file rev comment) | 1359 (lambda (file rev comment) |
1351 (message "Registering %s... " file) | 1360 (message "Registering %s... " file) |
1865 (defmacro vc-diff-switches-list (backend) | 1874 (defmacro vc-diff-switches-list (backend) |
1866 "Return the list of switches to use for executing diff under BACKEND." | 1875 "Return the list of switches to use for executing diff under BACKEND." |
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) |
1876 "List differences for all registered files at and below DIR. | 1889 "List differences for all registered files at and below DIR. |
1877 The meaning of REL1 and REL2 is the same as for `vc-version-diff'." | 1890 The meaning of REL1 and REL2 is the same as for `vc-version-diff'." |