diff options
| author | Dave Love | 2000-09-07 20:01:53 +0000 |
|---|---|---|
| committer | Dave Love | 2000-09-07 20:01:53 +0000 |
| commit | 0d685c4f7b454944e7c33d68d271e2784504e463 (patch) | |
| tree | 514cfa23ce3d42b660bdd571a1a9c27ddd7caf23 | |
| parent | 91a211b50d4f29fcd2a9f3a164e1baecbb09460e (diff) | |
| download | emacs-0d685c4f7b454944e7c33d68d271e2784504e463.tar.gz emacs-0d685c4f7b454944e7c33d68d271e2784504e463.zip | |
DOc fixes.
(vc-cvs-register-switches, vc-cvs-header, vc-cvs-use-edit)
(vc-cvs-stay-local): Add :version.
| -rw-r--r-- | lisp/vc-cvs.el | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index e7388ebbdd9..362e1e4032e 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: FSF (see vc.el for full credits) | 5 | ;; Author: FSF (see vc.el for full credits) |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 7 | 7 | ||
| 8 | ;; $Id: vc-cvs.el,v 1.1 2000/09/04 19:48:04 gerd Exp $ | 8 | ;; $Id: vc-cvs.el,v 1.2 2000/09/05 20:08:20 monnier Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -37,10 +37,12 @@ A string or list of strings passed to the checkin program by | |||
| 37 | (repeat :tag "Argument List" | 37 | (repeat :tag "Argument List" |
| 38 | :value ("") | 38 | :value ("") |
| 39 | string)) | 39 | string)) |
| 40 | :version "21.1" | ||
| 40 | :group 'vc) | 41 | :group 'vc) |
| 41 | 42 | ||
| 42 | (defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$")) | 43 | (defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$")) |
| 43 | "*Header keywords to be inserted by `vc-insert-headers'." | 44 | "*Header keywords to be inserted by `vc-insert-headers'." |
| 45 | :version "21.1" | ||
| 44 | :type 'string | 46 | :type 'string |
| 45 | :group 'vc) | 47 | :group 'vc) |
| 46 | 48 | ||
| @@ -49,19 +51,20 @@ A string or list of strings passed to the checkin program by | |||
| 49 | This is only meaningful if you don't use the implicit checkout model | 51 | This is only meaningful if you don't use the implicit checkout model |
| 50 | \(i.e. if you have $CVSREAD set)." | 52 | \(i.e. if you have $CVSREAD set)." |
| 51 | :type 'boolean | 53 | :type 'boolean |
| 54 | :version "21.1" | ||
| 52 | :group 'vc) | 55 | :group 'vc) |
| 53 | 56 | ||
| 54 | (defcustom vc-cvs-stay-local t | 57 | (defcustom vc-cvs-stay-local t |
| 55 | "*Non-nil means that for remote CVS repositories, VC will | 58 | "*Non-nil means use local operations when possible for remote repositories. |
| 56 | use local operations whenever possible, avoiding slow queries | 59 | This avoids slow queries over the network. Turning this option on |
| 57 | over the network. Turning this option on will instruct VC to use only | 60 | will instruct VC to use only heuristics and past information to |
| 58 | heuristics and past information to determine the current status of a | 61 | determine the current status of a file. The value can also be a |
| 59 | file. The value can also be a regular expression to match against the | 62 | regular expression to match against the host name of a repository; |
| 60 | host name of a repository; then VC only stays local for hosts that match | 63 | then VC only stays local for hosts that match it." |
| 61 | it." | ||
| 62 | :type '(choice (const :tag "Always stay local" t) | 64 | :type '(choice (const :tag "Always stay local" t) |
| 63 | (string :tag "Host regexp") | 65 | (string :tag "Host regexp") |
| 64 | (const :tag "Don't stay local" nil)) | 66 | (const :tag "Don't stay local" nil)) |
| 67 | :version "21.1" | ||
| 65 | :group 'vc) | 68 | :group 'vc) |
| 66 | 69 | ||
| 67 | ;;;###autoload (defun vc-cvs-registered (f) | 70 | ;;;###autoload (defun vc-cvs-registered (f) |
| @@ -80,8 +83,8 @@ it." | |||
| 80 | (with-temp-buffer | 83 | (with-temp-buffer |
| 81 | (vc-insert-file (expand-file-name "CVS/Entries" dirname)) | 84 | (vc-insert-file (expand-file-name "CVS/Entries" dirname)) |
| 82 | (goto-char (point-min)) | 85 | (goto-char (point-min)) |
| 83 | (cond | 86 | (cond |
| 84 | ((re-search-forward | 87 | ((re-search-forward |
| 85 | (concat "^/" (regexp-quote basename) "/") nil t) | 88 | (concat "^/" (regexp-quote basename) "/") nil t) |
| 86 | (beginning-of-line) | 89 | (beginning-of-line) |
| 87 | (vc-cvs-parse-entry file) | 90 | (vc-cvs-parse-entry file) |
| @@ -95,17 +98,17 @@ it." | |||
| 95 | (let* ((dirname (if (file-directory-p file) | 98 | (let* ((dirname (if (file-directory-p file) |
| 96 | (directory-file-name file) | 99 | (directory-file-name file) |
| 97 | (file-name-directory file))) | 100 | (file-name-directory file))) |
| 98 | (prop | 101 | (prop |
| 99 | (or (vc-file-getprop dirname 'vc-cvs-stay-local-p) | 102 | (or (vc-file-getprop dirname 'vc-cvs-stay-local-p) |
| 100 | (let ((rootname (expand-file-name "CVS/Root" dirname))) | 103 | (let ((rootname (expand-file-name "CVS/Root" dirname))) |
| 101 | (vc-file-setprop | 104 | (vc-file-setprop |
| 102 | dirname 'vc-cvs-stay-local-p | 105 | dirname 'vc-cvs-stay-local-p |
| 103 | (when (file-readable-p rootname) | 106 | (when (file-readable-p rootname) |
| 104 | (with-temp-buffer | 107 | (with-temp-buffer |
| 105 | (vc-insert-file rootname) | 108 | (vc-insert-file rootname) |
| 106 | (goto-char (point-min)) | 109 | (goto-char (point-min)) |
| 107 | (if (looking-at "\\([^:]*\\):") | 110 | (if (looking-at "\\([^:]*\\):") |
| 108 | (if (not (stringp vc-cvs-stay-local)) | 111 | (if (not (stringp vc-cvs-stay-local)) |
| 109 | 'yes | 112 | 'yes |
| 110 | (let ((hostname (match-string 1))) | 113 | (let ((hostname (match-string 1))) |
| 111 | (if (string-match vc-cvs-stay-local hostname) | 114 | (if (string-match vc-cvs-stay-local hostname) |
| @@ -253,9 +256,10 @@ special case of a CVS file that is added but not yet comitted." | |||
| 253 | (forward-line 1)))) | 256 | (forward-line 1)))) |
| 254 | 257 | ||
| 255 | (defun vc-cvs-parse-entry (file &optional set-state) | 258 | (defun vc-cvs-parse-entry (file &optional set-state) |
| 256 | "Parse a line from CVS/Entries, compare modification time to that of | 259 | "Parse a line from CVS/Entries. |
| 257 | the FILE, set file properties accordingly. However, vc-state is set only | 260 | Compare modification time to that of the FILE, set file properties |
| 258 | if optional arg SET-STATE is non-nil." | 261 | accordingly. However, `vc-state' is set only if optional arg SET-STATE |
| 262 | is non-nil." | ||
| 259 | (cond | 263 | (cond |
| 260 | ;; entry for a "locally added" file (not yet committed) | 264 | ;; entry for a "locally added" file (not yet committed) |
| 261 | ((looking-at "/[^/]+/0/") | 265 | ((looking-at "/[^/]+/0/") |
| @@ -263,7 +267,7 @@ if optional arg SET-STATE is non-nil." | |||
| 263 | (vc-file-setprop file 'vc-workfile-version "0") | 267 | (vc-file-setprop file 'vc-workfile-version "0") |
| 264 | (if set-state (vc-file-setprop file 'vc-state 'edited))) | 268 | (if set-state (vc-file-setprop file 'vc-state 'edited))) |
| 265 | ;; normal entry | 269 | ;; normal entry |
| 266 | ((looking-at | 270 | ((looking-at |
| 267 | (concat "/[^/]+" | 271 | (concat "/[^/]+" |
| 268 | ;; revision | 272 | ;; revision |
| 269 | "/\\([^/]*\\)" | 273 | "/\\([^/]*\\)" |
| @@ -368,7 +372,7 @@ If UPDATE is non-nil, then update (resynch) any affected buffers." | |||
| 368 | (state (match-string 1)) | 372 | (state (match-string 1)) |
| 369 | (buffer (find-buffer-visiting file))) | 373 | (buffer (find-buffer-visiting file))) |
| 370 | (when buffer | 374 | (when buffer |
| 371 | (cond | 375 | (cond |
| 372 | ((or (string= state "U") | 376 | ((or (string= state "U") |
| 373 | (string= state "P")) | 377 | (string= state "P")) |
| 374 | (vc-file-setprop file 'vc-state 'up-to-date) | 378 | (vc-file-setprop file 'vc-state 'up-to-date) |
| @@ -493,8 +497,7 @@ Inappropriate for CVS" | |||
| 493 | 1)) | 497 | 1)) |
| 494 | 498 | ||
| 495 | (defun vc-cvs-latest-on-branch-p (file) | 499 | (defun vc-cvs-latest-on-branch-p (file) |
| 496 | "Return t iff the current workfile version of FILE is the latest on | 500 | "Return t iff current workfile version of FILE is the latest on its branch." |
| 497 | its branch." | ||
| 498 | ;; Since this is only used as a sanity check for vc-cancel-version, | 501 | ;; Since this is only used as a sanity check for vc-cancel-version, |
| 499 | ;; and that is not supported under CVS at all, we can safely return t here. | 502 | ;; and that is not supported under CVS at all, we can safely return t here. |
| 500 | ;; TODO: Think of getting rid of this altogether. | 503 | ;; TODO: Think of getting rid of this altogether. |
| @@ -538,7 +541,7 @@ its branch." | |||
| 538 | 541 | ||
| 539 | (defun vc-cvs-responsible-p (file) | 542 | (defun vc-cvs-responsible-p (file) |
| 540 | "Return non-nil if CVS thinks it is responsible for FILE." | 543 | "Return non-nil if CVS thinks it is responsible for FILE." |
| 541 | (file-directory-p (expand-file-name "CVS" | 544 | (file-directory-p (expand-file-name "CVS" |
| 542 | (if (file-directory-p file) | 545 | (if (file-directory-p file) |
| 543 | file | 546 | file |
| 544 | (file-name-directory file))))) | 547 | (file-name-directory file))))) |
| @@ -621,33 +624,33 @@ REV is the revision to check out into WORKFILE." | |||
| 621 | (apply 'vc-do-command nil 0 "cvs" file | 624 | (apply 'vc-do-command nil 0 "cvs" file |
| 622 | (and writable | 625 | (and writable |
| 623 | (or (not (file-exists-p file)) | 626 | (or (not (file-exists-p file)) |
| 624 | (not (eq (vc-cvs-checkout-model file) | 627 | (not (eq (vc-cvs-checkout-model file) |
| 625 | 'implicit))) | 628 | 'implicit))) |
| 626 | "-w") | 629 | "-w") |
| 627 | "update" | 630 | "update" |
| 628 | ;; default for verbose checkout: clear the sticky tag so | 631 | ;; default for verbose checkout: clear the sticky tag so |
| 629 | ;; that the actual update will get the head of the trunk | 632 | ;; that the actual update will get the head of the trunk |
| 630 | (if (or (not rev) (string= rev "")) | 633 | (if (or (not rev) (string= rev "")) |
| 631 | "-A" | 634 | "-A" |
| 632 | (concat "-r" rev)) | 635 | (concat "-r" rev)) |
| 633 | switches)))) | 636 | switches)))) |
| 634 | (vc-mode-line file) | 637 | (vc-mode-line file) |
| 635 | (message "Checking out %s...done" filename))))) | 638 | (message "Checking out %s...done" filename))))) |
| 636 | 639 | ||
| 637 | (defun vc-cvs-annotate-command (file buffer) | 640 | (defun vc-cvs-annotate-command (file buffer) |
| 638 | "Execute \"cvs annotate\" on FILE by using `call-process' and insert | 641 | "Execute \"cvs annotate\" on FILE. |
| 639 | the contents in BUFFER." | 642 | Use `call-process' and insert the contents in BUFFER." |
| 640 | (call-process "cvs" nil buffer nil "annotate" file)) | 643 | (call-process "cvs" nil buffer nil "annotate" file)) |
| 641 | 644 | ||
| 642 | (defvar vc-cvs-local-month-numbers | 645 | (defvar vc-cvs-local-month-numbers |
| 643 | '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) | 646 | '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) |
| 644 | ("May" . 5) ("Jun" . 6) ("Jul" . 7) ("Aug" . 8) | 647 | ("May" . 5) ("Jun" . 6) ("Jul" . 7) ("Aug" . 8) |
| 645 | ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12)) | 648 | ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12)) |
| 646 | "Local association list of month numbers") | 649 | "Local association list of month numbers.") |
| 647 | 650 | ||
| 648 | (defun vc-cvs-annotate-difference (point) | 651 | (defun vc-cvs-annotate-difference (point) |
| 649 | "Return the difference between the time of the line and the current | 652 | "Return the difference between the time of the line and the current time. |
| 650 | time. Return values are as defined for `current-time'." | 653 | Return values are as defined for `current-time'." |
| 651 | ;; We need a list of months and their corresponding numbers. | 654 | ;; We need a list of months and their corresponding numbers. |
| 652 | (if (looking-at "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ") | 655 | (if (looking-at "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ") |
| 653 | (progn | 656 | (progn |
| @@ -666,7 +669,7 @@ time. Return values are as defined for `current-time'." | |||
| 666 | ;; If we did not look directly at an annotation, there might be | 669 | ;; If we did not look directly at an annotation, there might be |
| 667 | ;; some further down. This is the case if we are positioned at | 670 | ;; some further down. This is the case if we are positioned at |
| 668 | ;; the very top of the buffer, for instance. | 671 | ;; the very top of the buffer, for instance. |
| 669 | (if (re-search-forward | 672 | (if (re-search-forward |
| 670 | "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): " nil t) | 673 | "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): " nil t) |
| 671 | (progn | 674 | (progn |
| 672 | (beginning-of-line nil) | 675 | (beginning-of-line nil) |