]> code.delx.au - gnu-emacs/blob - lisp/vc-cvs.el
* fontset.c (fontset_find_font): Check frame validity.
[gnu-emacs] / lisp / vc-cvs.el
1 ;;; vc-cvs.el --- non-resident support for CVS version-control
2
3 ;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003,
4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5
6 ;; Author: FSF (see vc.el for full credits)
7 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8
9 ;; This file is part of GNU Emacs.
10
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25
26 ;;; Code:
27
28 (eval-when-compile (require 'cl) (require 'vc))
29
30 ;; Clear up the cache to force vc-call to check again and discover
31 ;; new functions when we reload this file.
32 (put 'CVS 'vc-functions nil)
33
34 ;;; Properties of the backend.
35
36 (defun vc-cvs-revision-granularity () 'file)
37
38 (defun vc-cvs-checkout-model (files)
39 "CVS-specific version of `vc-checkout-model'."
40 (if (getenv "CVSREAD")
41 'announce
42 (let* ((file (if (consp files) (car files) files))
43 (attrib (file-attributes file)))
44 (or (vc-file-getprop file 'vc-checkout-model)
45 (vc-file-setprop
46 file 'vc-checkout-model
47 (if (and attrib ;; don't check further if FILE doesn't exist
48 ;; If the file is not writable (despite CVSREAD being
49 ;; undefined), this is probably because the file is being
50 ;; "watched" by other developers.
51 ;; (If vc-mistrust-permissions was t, we actually shouldn't
52 ;; trust this, but there is no other way to learn this from
53 ;; CVS at the moment (version 1.9).)
54 (string-match "r-..-..-." (nth 8 attrib)))
55 'announce
56 'implicit))))))
57
58 ;;;
59 ;;; Customization options
60 ;;;
61
62 (defcustom vc-cvs-global-switches nil
63 "*Global switches to pass to any CVS command."
64 :type '(choice (const :tag "None" nil)
65 (string :tag "Argument String")
66 (repeat :tag "Argument List"
67 :value ("")
68 string))
69 :version "22.1"
70 :group 'vc)
71
72 (defcustom vc-cvs-register-switches nil
73 "*Extra switches for registering a file into CVS.
74 A string or list of strings passed to the checkin program by
75 \\[vc-register]."
76 :type '(choice (const :tag "None" nil)
77 (string :tag "Argument String")
78 (repeat :tag "Argument List"
79 :value ("")
80 string))
81 :version "21.1"
82 :group 'vc)
83
84 (defcustom vc-cvs-diff-switches nil
85 "*A string or list of strings specifying extra switches for cvs diff under VC."
86 :type '(choice (const :tag "None" nil)
87 (string :tag "Argument String")
88 (repeat :tag "Argument List"
89 :value ("")
90 string))
91 :version "21.1"
92 :group 'vc)
93
94 (defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$"))
95 "*Header keywords to be inserted by `vc-insert-headers'."
96 :version "21.1"
97 :type '(repeat string)
98 :group 'vc)
99
100 (defcustom vc-cvs-use-edit t
101 "*Non-nil means to use `cvs edit' to \"check out\" a file.
102 This is only meaningful if you don't use the implicit checkout model
103 \(i.e. if you have $CVSREAD set)."
104 :type 'boolean
105 :version "21.1"
106 :group 'vc)
107
108 (defcustom vc-cvs-stay-local t
109 "*Non-nil means use local operations when possible for remote repositories.
110 This avoids slow queries over the network and instead uses heuristics
111 and past information to determine the current status of a file.
112
113 The value can also be a regular expression or list of regular
114 expressions to match against the host name of a repository; then VC
115 only stays local for hosts that match it. Alternatively, the value
116 can be a list of regular expressions where the first element is the
117 symbol `except'; then VC always stays local except for hosts matched
118 by these regular expressions."
119 :type '(choice (const :tag "Always stay local" t)
120 (const :tag "Don't stay local" nil)
121 (list :format "\nExamine hostname and %v" :tag "Examine hostname ..."
122 (set :format "%v" :inline t (const :format "%t" :tag "don't" except))
123 (regexp :format " stay local,\n%t: %v" :tag "if it matches")
124 (repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
125 :version "21.1"
126 :group 'vc)
127
128 (defcustom vc-cvs-sticky-date-format-string "%c"
129 "*Format string for mode-line display of sticky date.
130 Format is according to `format-time-string'. Only used if
131 `vc-cvs-sticky-tag-display' is t."
132 :type '(string)
133 :version "22.1"
134 :group 'vc)
135
136 (defcustom vc-cvs-sticky-tag-display t
137 "*Specify the mode-line display of sticky tags.
138 Value t means default display, nil means no display at all. If the
139 value is a function or macro, it is called with the sticky tag and
140 its' type as parameters, in that order. TYPE can have three different
141 values: `symbolic-name' (TAG is a string), `revision-number' (TAG is a
142 string) and `date' (TAG is a date as returned by `encode-time'). The
143 return value of the function or macro will be displayed as a string.
144
145 Here's an example that will display the formatted date for sticky
146 dates and the word \"Sticky\" for sticky tag names and revisions.
147
148 (lambda (tag type)
149 (cond ((eq type 'date) (format-time-string
150 vc-cvs-sticky-date-format-string tag))
151 ((eq type 'revision-number) \"Sticky\")
152 ((eq type 'symbolic-name) \"Sticky\")))
153
154 Here's an example that will abbreviate to the first character only,
155 any text before the first occurrence of `-' for sticky symbolic tags.
156 If the sticky tag is a revision number, the word \"Sticky\" is
157 displayed. Date and time is displayed for sticky dates.
158
159 (lambda (tag type)
160 (cond ((eq type 'date) (format-time-string \"%Y%m%d %H:%M\" tag))
161 ((eq type 'revision-number) \"Sticky\")
162 ((eq type 'symbolic-name)
163 (condition-case nil
164 (progn
165 (string-match \"\\\\([^-]*\\\\)\\\\(.*\\\\)\" tag)
166 (concat (substring (match-string 1 tag) 0 1) \":\"
167 (substring (match-string 2 tag) 1 nil)))
168 (error tag))))) ; Fall-back to given tag name.
169
170 See also variable `vc-cvs-sticky-date-format-string'."
171 :type '(choice boolean function)
172 :version "22.1"
173 :group 'vc)
174
175 ;;;
176 ;;; Internal variables
177 ;;;
178
179
180 ;;;
181 ;;; State-querying functions
182 ;;;
183
184 ;;;###autoload (defun vc-cvs-registered (f)
185 ;;;###autoload (when (file-readable-p (expand-file-name
186 ;;;###autoload "CVS/Entries" (file-name-directory f)))
187 ;;;###autoload (load "vc-cvs")
188 ;;;###autoload (vc-cvs-registered f)))
189
190 (defun vc-cvs-registered (file)
191 "Check if FILE is CVS registered."
192 (let ((dirname (or (file-name-directory file) ""))
193 (basename (file-name-nondirectory file))
194 ;; make sure that the file name is searched case-sensitively
195 (case-fold-search nil))
196 (if (file-readable-p (expand-file-name "CVS/Entries" dirname))
197 (or (string= basename "")
198 (with-temp-buffer
199 (vc-cvs-get-entries dirname)
200 (goto-char (point-min))
201 (cond ((re-search-forward
202 (concat "^/" (regexp-quote basename) "/[^/]") nil t)
203 (beginning-of-line)
204 (vc-cvs-parse-entry file)
205 t)
206 (t nil))))
207 nil)))
208
209 (defun vc-cvs-state (file)
210 "CVS-specific version of `vc-state'."
211 (if (vc-stay-local-p file)
212 (let ((state (vc-file-getprop file 'vc-state)))
213 ;; If we should stay local, use the heuristic but only if
214 ;; we don't have a more precise state already available.
215 (if (memq state '(up-to-date edited nil))
216 (vc-cvs-state-heuristic file)
217 state))
218 (with-temp-buffer
219 (cd (file-name-directory file))
220 (vc-cvs-command t 0 file "status")
221 (vc-cvs-parse-status t))))
222
223 (defun vc-cvs-state-heuristic (file)
224 "CVS-specific state heuristic."
225 ;; If the file has not changed since checkout, consider it `up-to-date'.
226 ;; Otherwise consider it `edited'.
227 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
228 (lastmod (nth 5 (file-attributes file))))
229 (cond
230 ((equal checkout-time lastmod) 'up-to-date)
231 ((string= (vc-working-revision file) "0") 'added)
232 ((null checkout-time) 'unregistered)
233 (t 'edited))))
234
235 (defun vc-cvs-working-revision (file)
236 "CVS-specific version of `vc-working-revision'."
237 ;; There is no need to consult RCS headers under CVS, because we
238 ;; get the workfile version for free when we recognize that a file
239 ;; is registered in CVS.
240 (vc-cvs-registered file)
241 (vc-file-getprop file 'vc-working-revision))
242
243 (defun vc-cvs-mode-line-string (file)
244 "Return string for placement into the modeline for FILE.
245 Compared to the default implementation, this function does two things:
246 Handle the special case of a CVS file that is added but not yet
247 committed and support display of sticky tags."
248 (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
249 help-echo
250 (string
251 (let ((def-ml (vc-default-mode-line-string 'CVS file)))
252 (setq help-echo
253 (get-text-property 0 'help-echo def-ml))
254 def-ml)))
255 (propertize
256 (if (zerop (length sticky-tag))
257 string
258 (setq help-echo (format "%s on the '%s' branch"
259 help-echo sticky-tag))
260 (concat string "[" sticky-tag "]"))
261 'help-echo help-echo)))
262
263
264 ;;;
265 ;;; State-changing functions
266 ;;;
267
268 (defun vc-cvs-register (files &optional rev comment)
269 "Register FILES into the CVS version-control system.
270 COMMENT can be used to provide an initial description of FILES.
271
272 `vc-register-switches' and `vc-cvs-register-switches' are passed to
273 the CVS command (in that order)."
274 ;; Register the directories if needed.
275 (let (dirs)
276 (dolist (file files)
277 (and (not (vc-cvs-responsible-p file))
278 (vc-cvs-could-register file)
279 (push (directory-file-name (file-name-directory file)) dirs)))
280 (if dirs (vc-cvs-register dirs)))
281 (apply 'vc-cvs-command nil 0 files
282 "add"
283 (and comment (string-match "[^\t\n ]" comment)
284 (concat "-m" comment))
285 (vc-switches 'CVS 'register)))
286
287 (defun vc-cvs-responsible-p (file)
288 "Return non-nil if CVS thinks it is responsible for FILE."
289 (file-directory-p (expand-file-name "CVS"
290 (if (file-directory-p file)
291 file
292 (file-name-directory file)))))
293
294 (defun vc-cvs-could-register (file)
295 "Return non-nil if FILE could be registered in CVS.
296 This is only possible if CVS is managing FILE's directory or one of
297 its parents."
298 (let ((dir file))
299 (while (and (stringp dir)
300 (not (equal dir (setq dir (file-name-directory dir))))
301 dir)
302 (setq dir (if (file-directory-p
303 (expand-file-name "CVS/Entries" dir))
304 t (directory-file-name dir))))
305 (eq dir t)))
306
307 (defun vc-cvs-checkin (files rev comment)
308 "CVS-specific version of `vc-backend-checkin'."
309 (unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
310 (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
311 (error "%s is not a valid symbolic tag name" rev)
312 ;; If the input revison is a valid symbolic tag name, we create it
313 ;; as a branch, commit and switch to it.
314 (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev))
315 (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev))
316 (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev))
317 files)))
318 (let ((status (apply 'vc-cvs-command nil 1 files
319 "ci" (if rev (concat "-r" rev))
320 (concat "-m" comment)
321 (vc-switches 'CVS 'checkin))))
322 (set-buffer "*vc*")
323 (goto-char (point-min))
324 (when (not (zerop status))
325 ;; Check checkin problem.
326 (cond
327 ((re-search-forward "Up-to-date check failed" nil t)
328 (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge))
329 files)
330 (error "%s" (substitute-command-keys
331 (concat "Up-to-date check failed: "
332 "type \\[vc-next-action] to merge in changes"))))
333 (t
334 (pop-to-buffer (current-buffer))
335 (goto-char (point-min))
336 (shrink-window-if-larger-than-buffer)
337 (error "Check-in failed"))))
338 ;; Single-file commit? Then update the revision by parsing the buffer.
339 ;; Otherwise we can't necessarily tell what goes with what; clear
340 ;; its properties so they have to be refetched.
341 (if (= (length files) 1)
342 (vc-file-setprop
343 (car files) 'vc-working-revision
344 (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
345 (mapc 'vc-file-clearprops files))
346 ;; Anyway, forget the checkout model of the file, because we might have
347 ;; guessed wrong when we found the file. After commit, we can
348 ;; tell it from the permissions of the file (see
349 ;; vc-cvs-checkout-model).
350 (mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil))
351 files)
352
353 ;; if this was an explicit check-in (does not include creation of
354 ;; a branch), remove the sticky tag.
355 (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
356 (vc-cvs-command nil 0 files "update" "-A"))))
357
358 (defun vc-cvs-find-revision (file rev buffer)
359 (apply 'vc-cvs-command
360 buffer 0 file
361 "-Q" ; suppress diagnostic output
362 "update"
363 (and rev (not (string= rev ""))
364 (concat "-r" rev))
365 "-p"
366 (vc-switches 'CVS 'checkout)))
367
368 (defun vc-cvs-checkout (file &optional editable rev)
369 "Checkout a revision of FILE into the working area.
370 EDITABLE non-nil means that the file should be writable.
371 REV is the revision to check out."
372 (message "Checking out %s..." file)
373 ;; Change buffers to get local value of vc-checkout-switches.
374 (with-current-buffer (or (get-file-buffer file) (current-buffer))
375 (if (and (file-exists-p file) (not rev))
376 ;; If no revision was specified, just make the file writable
377 ;; if necessary (using `cvs-edit' if requested).
378 (and editable (not (eq (vc-cvs-checkout-model (list file)) 'implicit))
379 (if vc-cvs-use-edit
380 (vc-cvs-command nil 0 file "edit")
381 (set-file-modes file (logior (file-modes file) 128))
382 (if (equal file buffer-file-name) (toggle-read-only -1))))
383 ;; Check out a particular revision (or recreate the file).
384 (vc-file-setprop file 'vc-working-revision nil)
385 (apply 'vc-cvs-command nil 0 file
386 (and editable "-w")
387 "update"
388 (when rev
389 (unless (eq rev t)
390 ;; default for verbose checkout: clear the
391 ;; sticky tag so that the actual update will
392 ;; get the head of the trunk
393 (if (string= rev "")
394 "-A"
395 (concat "-r" rev))))
396 (vc-switches 'CVS 'checkout)))
397 (vc-mode-line file))
398 (message "Checking out %s...done" file))
399
400 (defun vc-cvs-delete-file (file)
401 (vc-cvs-command nil 0 file "remove" "-f"))
402
403 (defun vc-cvs-revert (file &optional contents-done)
404 "Revert FILE to the working revision on which it was based."
405 (vc-default-revert 'CVS file contents-done)
406 (unless (eq (vc-cvs-checkout-model (list file)) 'implicit)
407 (if vc-cvs-use-edit
408 (vc-cvs-command nil 0 file "unedit")
409 ;; Make the file read-only by switching off all w-bits
410 (set-file-modes file (logand (file-modes file) 3950)))))
411
412 (defun vc-cvs-merge (file first-revision &optional second-revision)
413 "Merge changes into current working copy of FILE.
414 The changes are between FIRST-REVISION and SECOND-REVISION."
415 (vc-cvs-command nil 0 file
416 "update" "-kk"
417 (concat "-j" first-revision)
418 (concat "-j" second-revision))
419 (vc-file-setprop file 'vc-state 'edited)
420 (with-current-buffer (get-buffer "*vc*")
421 (goto-char (point-min))
422 (if (re-search-forward "conflicts during merge" nil t)
423 (progn
424 (vc-file-setprop file 'vc-state 'conflict)
425 ;; signal error
426 1)
427 (vc-file-setprop file 'vc-state 'edited)
428 ;; signal success
429 0)))
430
431 (defun vc-cvs-merge-news (file)
432 "Merge in any new changes made to FILE."
433 (message "Merging changes into %s..." file)
434 ;; (vc-file-setprop file 'vc-working-revision nil)
435 (vc-file-setprop file 'vc-checkout-time 0)
436 (vc-cvs-command nil nil file "update")
437 ;; Analyze the merge result reported by CVS, and set
438 ;; file properties accordingly.
439 (with-current-buffer (get-buffer "*vc*")
440 (goto-char (point-min))
441 ;; get new working revision
442 (if (re-search-forward
443 "^Merging differences between [0-9.]* and \\([0-9.]*\\) into" nil t)
444 (vc-file-setprop file 'vc-working-revision (match-string 1))
445 (vc-file-setprop file 'vc-working-revision nil))
446 ;; get file status
447 (prog1
448 (if (eq (buffer-size) 0)
449 0 ;; there were no news; indicate success
450 (if (re-search-forward
451 (concat "^\\([CMUP] \\)?"
452 (regexp-quote (file-name-nondirectory file))
453 "\\( already contains the differences between \\)?")
454 nil t)
455 (cond
456 ;; Merge successful, we are in sync with repository now
457 ((or (match-string 2)
458 (string= (match-string 1) "U ")
459 (string= (match-string 1) "P "))
460 (vc-file-setprop file 'vc-state 'up-to-date)
461 (vc-file-setprop file 'vc-checkout-time
462 (nth 5 (file-attributes file)))
463 0);; indicate success to the caller
464 ;; Merge successful, but our own changes are still in the file
465 ((string= (match-string 1) "M ")
466 (vc-file-setprop file 'vc-state 'edited)
467 0);; indicate success to the caller
468 ;; Conflicts detected!
469 (t
470 (vc-file-setprop file 'vc-state 'conflict)
471 1);; signal the error to the caller
472 )
473 (pop-to-buffer "*vc*")
474 (error "Couldn't analyze cvs update result")))
475 (message "Merging changes into %s...done" file))))
476
477 (defun vc-cvs-modify-change-comment (files rev comment)
478 "Modify the change comments for FILES on a specified REV.
479 Will fail unless you have administrative privileges on the repo."
480 (vc-cvs-command nil 0 files "admin" (concat "-m" rev ":" comment)))
481
482 ;;;
483 ;;; History functions
484 ;;;
485
486 (defun vc-cvs-print-log (files &optional buffer)
487 "Get change logs associated with FILES."
488 ;; It's just the catenation of the individual logs.
489 (vc-cvs-command
490 buffer
491 (if (vc-stay-local-p files) 'async 0)
492 files "log"))
493
494 (defun vc-cvs-comment-history (file)
495 "Get comment history of a file."
496 (vc-call-backend 'RCS 'comment-history file))
497
498 (defun vc-cvs-diff (files &optional oldvers newvers buffer)
499 "Get a difference report using CVS between two revisions of FILE."
500 (let* ((async (and (not vc-disable-async-diff)
501 (vc-stay-local-p files)))
502 (invoke-cvs-diff-list nil)
503 status)
504 ;; Look through the file list and see if any files have backups
505 ;; that can be used to do a plain "diff" instead of "cvs diff".
506 (dolist (file files)
507 (let ((ov oldvers)
508 (nv newvers))
509 (when (or (not ov) (string-equal ov ""))
510 (setq ov (vc-working-revision file)))
511 (when (string-equal nv "")
512 (setq nv nil))
513 (let ((file-oldvers (vc-version-backup-file file ov))
514 (file-newvers (if (not nv)
515 file
516 (vc-version-backup-file file nv)))
517 (coding-system-for-read (vc-coding-system-for-diff file)))
518 (if (and file-oldvers file-newvers)
519 (progn
520 (apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil
521 (append (if (listp diff-switches)
522 diff-switches
523 (list diff-switches))
524 (if (listp vc-diff-switches)
525 vc-diff-switches
526 (list vc-diff-switches))
527 (list (file-relative-name file-oldvers)
528 (file-relative-name file-newvers))))
529 (setq status 0))
530 (push file invoke-cvs-diff-list)))))
531 (when invoke-cvs-diff-list
532 (setq status (apply 'vc-cvs-command (or buffer "*vc-diff*")
533 (if async 'async 1)
534 invoke-cvs-diff-list "diff"
535 (and oldvers (concat "-r" oldvers))
536 (and newvers (concat "-r" newvers))
537 (vc-switches 'CVS 'diff))))
538 (if async 1 status))) ; async diff, pessimistic assumption
539
540 (defconst vc-cvs-annotate-first-line-re "^[0-9]")
541
542 (defun vc-cvs-annotate-process-filter (process string)
543 (setq string (concat (process-get process 'output) string))
544 (if (not (string-match vc-cvs-annotate-first-line-re string))
545 ;; Still waiting for the first real line.
546 (process-put process 'output string)
547 (let ((vc-filter (process-get process 'vc-filter)))
548 (set-process-filter process vc-filter)
549 (funcall vc-filter process (substring string (match-beginning 0))))))
550
551 (defun vc-cvs-annotate-command (file buffer &optional revision)
552 "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
553 Optional arg REVISION is a revision to annotate from."
554 (vc-cvs-command buffer
555 (if (vc-stay-local-p file)
556 'async 0)
557 file "annotate"
558 (if revision (concat "-r" revision)))
559 ;; Strip the leading few lines.
560 (let ((proc (get-buffer-process buffer)))
561 (if proc
562 ;; If running asynchronously, use a process filter.
563 (progn
564 (process-put proc 'vc-filter (process-filter proc))
565 (set-process-filter proc 'vc-cvs-annotate-process-filter))
566 (with-current-buffer buffer
567 (goto-char (point-min))
568 (re-search-forward vc-cvs-annotate-first-line-re)
569 (delete-region (point-min) (1- (point)))))))
570
571 (declare-function vc-annotate-convert-time "vc-annotate" (time))
572
573 (defun vc-cvs-annotate-current-time ()
574 "Return the current time, based at midnight of the current day, and
575 encoded as fractional days."
576 (vc-annotate-convert-time
577 (apply 'encode-time 0 0 0 (nthcdr 3 (decode-time (current-time))))))
578
579 (defun vc-cvs-annotate-time ()
580 "Return the time of the next annotation (as fraction of days)
581 systime, or nil if there is none."
582 (let* ((bol (point))
583 (cache (get-text-property bol 'vc-cvs-annotate-time))
584 (inhibit-read-only t)
585 (inhibit-modification-hooks t))
586 (cond
587 (cache)
588 ((looking-at
589 "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ")
590 (let ((day (string-to-number (match-string 1)))
591 (month (cdr (assq (intern (match-string 2))
592 '((Jan . 1) (Feb . 2) (Mar . 3)
593 (Apr . 4) (May . 5) (Jun . 6)
594 (Jul . 7) (Aug . 8) (Sep . 9)
595 (Oct . 10) (Nov . 11) (Dec . 12)))))
596 (year (let ((tmp (string-to-number (match-string 3))))
597 ;; Years 0..68 are 2000..2068.
598 ;; Years 69..99 are 1969..1999.
599 (+ (cond ((> 69 tmp) 2000)
600 ((> 100 tmp) 1900)
601 (t 0))
602 tmp))))
603 (put-text-property
604 bol (1+ bol) 'vc-cvs-annotate-time
605 (setq cache (cons
606 ;; Position at end makes for nicer overlay result.
607 ;; Don't put actual buffer pos here, but only relative
608 ;; distance, so we don't ever move backward in the
609 ;; goto-char below, even if the text is moved.
610 (- (match-end 0) (match-beginning 0))
611 (vc-annotate-convert-time
612 (encode-time 0 0 0 day month year))))))))
613 (when cache
614 (goto-char (+ bol (car cache))) ; Fontify from here to eol.
615 (cdr cache)))) ; days (float)
616
617 (defun vc-cvs-annotate-extract-revision-at-line ()
618 (save-excursion
619 (beginning-of-line)
620 (if (re-search-forward "^\\([0-9]+\\.[0-9]+\\(\\.[0-9]+\\)*\\) +("
621 (line-end-position) t)
622 (match-string-no-properties 1)
623 nil)))
624
625 ;;;
626 ;;; Tag system
627 ;;;
628
629 (defun vc-cvs-create-tag (dir name branchp)
630 "Assign to DIR's current revision a given NAME.
631 If BRANCHP is non-nil, the name is created as a branch (and the current
632 workspace is immediately moved to that new branch)."
633 (vc-cvs-command nil 0 dir "tag" "-c" (if branchp "-b") name)
634 (when branchp (vc-cvs-command nil 0 dir "update" "-r" name)))
635
636 (defun vc-cvs-retrieve-tag (dir name update)
637 "Retrieve a tag at and below DIR.
638 NAME is the name of the tag; if it is empty, do a `cvs update'.
639 If UPDATE is non-nil, then update (resynch) any affected buffers."
640 (with-current-buffer (get-buffer-create "*vc*")
641 (let ((default-directory dir)
642 (sticky-tag))
643 (erase-buffer)
644 (if (or (not name) (string= name ""))
645 (vc-cvs-command t 0 nil "update")
646 (vc-cvs-command t 0 nil "update" "-r" name)
647 (setq sticky-tag name))
648 (when update
649 (goto-char (point-min))
650 (while (not (eobp))
651 (if (looking-at "\\([CMUP]\\) \\(.*\\)")
652 (let* ((file (expand-file-name (match-string 2) dir))
653 (state (match-string 1))
654 (buffer (find-buffer-visiting file)))
655 (when buffer
656 (cond
657 ((or (string= state "U")
658 (string= state "P"))
659 (vc-file-setprop file 'vc-state 'up-to-date)
660 (vc-file-setprop file 'vc-working-revision nil)
661 (vc-file-setprop file 'vc-checkout-time
662 (nth 5 (file-attributes file))))
663 ((or (string= state "M")
664 (string= state "C"))
665 (vc-file-setprop file 'vc-state 'edited)
666 (vc-file-setprop file 'vc-working-revision nil)
667 (vc-file-setprop file 'vc-checkout-time 0)))
668 (vc-file-setprop file 'vc-cvs-sticky-tag sticky-tag)
669 (vc-resynch-buffer file t t))))
670 (forward-line 1))))))
671
672
673 ;;;
674 ;;; Miscellaneous
675 ;;;
676
677 (defalias 'vc-cvs-make-version-backups-p 'vc-stay-local-p
678 "Return non-nil if version backups should be made for FILE.")
679
680 (defun vc-cvs-check-headers ()
681 "Check if the current file has any headers in it."
682 (save-excursion
683 (goto-char (point-min))
684 (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\
685 \\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
686
687
688 ;;;
689 ;;; Internal functions
690 ;;;
691
692 (defun vc-cvs-command (buffer okstatus files &rest flags)
693 "A wrapper around `vc-do-command' for use in vc-cvs.el.
694 The difference to vc-do-command is that this function always invokes `cvs',
695 and that it passes `vc-cvs-global-switches' to it before FLAGS."
696 (apply 'vc-do-command (or buffer "*vc*") okstatus "cvs" files
697 (if (stringp vc-cvs-global-switches)
698 (cons vc-cvs-global-switches flags)
699 (append vc-cvs-global-switches
700 flags))))
701
702 (defalias 'vc-cvs-stay-local-p 'vc-stay-local-p) ;Back-compatibility.
703
704 (defun vc-cvs-repository-hostname (dirname)
705 "Hostname of the CVS server associated to workarea DIRNAME."
706 (let ((rootname (expand-file-name "CVS/Root" dirname)))
707 (when (file-readable-p rootname)
708 (with-temp-buffer
709 (let ((coding-system-for-read
710 (or file-name-coding-system
711 default-file-name-coding-system)))
712 (vc-insert-file rootname))
713 (goto-char (point-min))
714 (nth 2 (vc-cvs-parse-root
715 (buffer-substring (point)
716 (line-end-position))))))))
717
718 (defun vc-cvs-parse-root (root)
719 "Split CVS ROOT specification string into a list of fields.
720 A CVS root specification of the form
721 [:METHOD:][[USER@]HOSTNAME:]/path/to/repository
722 is converted to a normalized record with the following structure:
723 \(METHOD USER HOSTNAME CVS-ROOT).
724 The default METHOD for a CVS root of the form
725 /path/to/repository
726 is `local'.
727 The default METHOD for a CVS root of the form
728 [USER@]HOSTNAME:/path/to/repository
729 is `ext'.
730 For an empty string, nil is returned (invalid CVS root)."
731 ;; Split CVS root into colon separated fields (0-4).
732 ;; The `x:' makes sure, that leading colons are not lost;
733 ;; `HOST:/PATH' is then different from `:METHOD:/PATH'.
734 (let* ((root-list (cdr (split-string (concat "x:" root) ":")))
735 (len (length root-list))
736 ;; All syntactic varieties will get a proper METHOD.
737 (root-list
738 (cond
739 ((= len 0)
740 ;; Invalid CVS root
741 nil)
742 ((= len 1)
743 ;; Simple PATH => method `local'
744 (cons "local"
745 (cons nil root-list)))
746 ((= len 2)
747 ;; [USER@]HOST:PATH => method `ext'
748 (and (not (equal (car root-list) ""))
749 (cons "ext" root-list)))
750 ((= len 3)
751 ;; :METHOD:PATH
752 (cons (cadr root-list)
753 (cons nil (cddr root-list))))
754 (t
755 ;; :METHOD:[USER@]HOST:PATH
756 (cdr root-list)))))
757 (if root-list
758 (let ((method (car root-list))
759 (uhost (or (cadr root-list) ""))
760 (root (nth 2 root-list))
761 user host)
762 ;; Split USER@HOST
763 (if (string-match "\\(.*\\)@\\(.*\\)" uhost)
764 (setq user (match-string 1 uhost)
765 host (match-string 2 uhost))
766 (setq host uhost))
767 ;; Remove empty HOST
768 (and (equal host "")
769 (setq host))
770 ;; Fix windows style CVS root `:local:C:\\project\\cvs\\some\\dir'
771 (and host
772 (equal method "local")
773 (setq root (concat host ":" root) host))
774 ;; Normalize CVS root record
775 (list method user host root)))))
776
777 ;; XXX: This does not work correctly for subdirectories. "cvs status"
778 ;; information is context sensitive, it contains lines like:
779 ;; cvs status: Examining DIRNAME
780 ;; and the file entries after that don't show the full path.
781 ;; Because of this VC directory listings only show changed files
782 ;; at the top level for CVS.
783 (defun vc-cvs-parse-status (&optional full)
784 "Parse output of \"cvs status\" command in the current buffer.
785 Set file properties accordingly. Unless FULL is t, parse only
786 essential information. Note that this can never set the 'ignored
787 state."
788 (let (file status missing)
789 (goto-char (point-min))
790 (while (looking-at "? \\(.*\\)")
791 (setq file (expand-file-name (match-string 1)))
792 (vc-file-setprop file 'vc-state 'unregistered)
793 (forward-line 1))
794 (when (re-search-forward "^File: " nil t)
795 (when (setq missing (looking-at "no file "))
796 (goto-char (match-end 0)))
797 (cond
798 ((re-search-forward "\\=\\([^ \t]+\\)" nil t)
799 (setq file (expand-file-name (match-string 1)))
800 (setq status(if (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)
801 (match-string 1) "Unknown"))
802 (when (and full
803 (re-search-forward
804 "\\(RCS Version\\|RCS Revision\\|Repository revision\\):\
805 \[\t ]+\\([0-9.]+\\)"
806 nil t))
807 (vc-file-setprop file 'vc-latest-revision (match-string 2)))
808 (vc-file-setprop
809 file 'vc-state
810 (cond
811 ((string-match "Up-to-date" status)
812 (vc-file-setprop file 'vc-checkout-time
813 (nth 5 (file-attributes file)))
814 'up-to-date)
815 ((string-match "Locally Modified" status) 'edited)
816 ((string-match "Needs Merge" status) 'needs-merge)
817 ((string-match "Needs \\(Checkout\\|Patch\\)" status)
818 (if missing 'missing 'needs-update))
819 ((string-match "Locally Added" status) 'added)
820 ((string-match "Locally Removed" status) 'removed)
821 ((string-match "File had conflicts " status) 'conflict)
822 ((string-match "Unknown" status) 'unregistered)
823 (t 'edited))))))))
824
825 (defun vc-cvs-after-dir-status (update-function)
826 ;; Heavily inspired by vc-cvs-parse-status. AKA a quick hack.
827 ;; This needs a lot of testing.
828 (let ((status nil)
829 (status-str nil)
830 (file nil)
831 (result nil)
832 (missing nil)
833 (ignore-next nil)
834 (subdir default-directory))
835 (goto-char (point-min))
836 (while
837 ;; Look for either a file entry, an unregistered file, or a
838 ;; directory change.
839 (re-search-forward
840 "\\(^=+\n\\([^=c?\n].*\n\\|\n\\)+\\)\\|\\(\\(^?? .*\n\\)+\\)\\|\\(^cvs status: \\(Examining\\|nothing\\) .*\n\\)"
841 nil t)
842 ;; FIXME: get rid of narrowing here.
843 (narrow-to-region (match-beginning 0) (match-end 0))
844 (goto-char (point-min))
845 ;; The subdir
846 (when (looking-at "cvs status: Examining \\(.+\\)")
847 (setq subdir (expand-file-name (match-string 1))))
848 ;; Unregistered files
849 (while (looking-at "? \\(.*\\)")
850 (setq file (file-relative-name
851 (expand-file-name (match-string 1) subdir)))
852 (push (list file 'unregistered) result)
853 (forward-line 1))
854 (when (looking-at "cvs status: nothing known about")
855 ;; We asked about a non existent file. The output looks like this:
856
857 ;; cvs status: nothing known about `lisp/v.diff'
858 ;; ===================================================================
859 ;; File: no file v.diff Status: Unknown
860 ;;
861 ;; Working revision: No entry for v.diff
862 ;; Repository revision: No revision control file
863 ;;
864
865 ;; Due to narrowing in this iteration we only see the "cvs
866 ;; status:" line, so just set a flag so that we can ignore the
867 ;; file in the next iteration.
868 (setq ignore-next t))
869 ;; A file entry.
870 (when (re-search-forward "^File: \\(no file \\)?\\(.*[^ \t]\\)[ \t]+Status: \\(.*\\)" nil t)
871 (setq missing (match-string 1))
872 (setq file (file-relative-name
873 (expand-file-name (match-string 2) subdir)))
874 (setq status-str (match-string 3))
875 (setq status
876 (cond
877 ((string-match "Up-to-date" status-str) 'up-to-date)
878 ((string-match "Locally Modified" status-str) 'edited)
879 ((string-match "Needs Merge" status-str) 'needs-merge)
880 ((string-match "Needs \\(Checkout\\|Patch\\)" status-str)
881 (if missing 'missing 'needs-update))
882 ((string-match "Locally Added" status-str) 'added)
883 ((string-match "Locally Removed" status-str) 'removed)
884 ((string-match "File had conflicts " status-str) 'conflict)
885 ((string-match "Unknown" status-str) 'unregistered)
886 (t 'edited)))
887 (if ignore-next
888 (setq ignore-next nil)
889 (unless (eq status 'up-to-date)
890 (push (list file status) result))))
891 (goto-char (point-max))
892 (widen))
893 (funcall update-function result))
894 ;; Alternative implementation: use the "update" command instead of
895 ;; the "status" command.
896 ;; (let ((result nil)
897 ;; (translation '((?? . unregistered)
898 ;; (?A . added)
899 ;; (?C . conflict)
900 ;; (?M . edited)
901 ;; (?P . needs-merge)
902 ;; (?R . removed)
903 ;; (?U . needs-update))))
904 ;; (goto-char (point-min))
905 ;; (while (not (eobp))
906 ;; (if (looking-at "^[ACMPRU?] \\(.*\\)$")
907 ;; (push (list (match-string 1)
908 ;; (cdr (assoc (char-after) translation)))
909 ;; result)
910 ;; (cond
911 ;; ((looking-at "cvs update: warning: \\(.*\\) was lost")
912 ;; ;; Format is:
913 ;; ;; cvs update: warning: FILENAME was lost
914 ;; ;; U FILENAME
915 ;; (push (list (match-string 1) 'missing) result)
916 ;; ;; Skip the "U" line
917 ;; (forward-line 1))
918 ;; ((looking-at "cvs update: New directory `\\(.*\\)' -- ignored")
919 ;; (push (list (match-string 1) 'unregistered) result))))
920 ;; (forward-line 1))
921 ;; (funcall update-function result)))
922 )
923
924 ;; Based on vc-cvs-dir-state-heuristic from Emacs 22.
925 (defun vc-cvs-dir-status-heuristic (dir update-function &optional basedir)
926 "Find the CVS state of all files in DIR, using only local information."
927 (let (file basename status result dirlist)
928 (with-temp-buffer
929 (vc-cvs-get-entries dir)
930 (goto-char (point-min))
931 (while (not (eobp))
932 (if (looking-at "D/\\([^/]*\\)////")
933 (push (expand-file-name (match-string 1) dir) dirlist)
934 ;; CVS-removed files are not taken under VC control.
935 (when (looking-at "/\\([^/]*\\)/[^/-]")
936 (setq basename (match-string 1)
937 file (expand-file-name basename dir)
938 status (or (vc-file-getprop file 'vc-state)
939 (vc-cvs-parse-entry file t)))
940 (unless (eq status 'up-to-date)
941 (push (list (if basedir
942 (file-relative-name file basedir)
943 basename)
944 status) result))))
945 (forward-line 1)))
946 (dolist (subdir dirlist)
947 (setq result (append result
948 (vc-cvs-dir-status-heuristic subdir nil
949 (or basedir dir)))))
950 (if basedir result
951 (funcall update-function result))))
952
953 (defun vc-cvs-dir-status (dir update-function)
954 "Create a list of conses (file . state) for DIR."
955 ;; FIXME check all files in DIR instead?
956 (if (vc-stay-local-p dir)
957 (vc-cvs-dir-status-heuristic dir update-function)
958 (vc-cvs-command (current-buffer) 'async dir "-f" "status")
959 ;; Alternative implementation: use the "update" command instead of
960 ;; the "status" command.
961 ;; (vc-cvs-command (current-buffer) 'async
962 ;; (file-relative-name dir)
963 ;; "-f" "-n" "update" "-d" "-P")
964 (vc-exec-after
965 `(vc-cvs-after-dir-status (quote ,update-function)))))
966
967 (defun vc-cvs-dir-status-files (dir files default-state update-function)
968 "Create a list of conses (file . state) for DIR."
969 (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files)
970 (vc-exec-after
971 `(vc-cvs-after-dir-status (quote ,update-function))))
972
973 (defun vc-cvs-file-to-string (file)
974 "Read the content of FILE and return it as a string."
975 (condition-case nil
976 (with-temp-buffer
977 (insert-file-contents file)
978 (goto-char (point-min))
979 (buffer-substring (point) (point-max)))
980 (file-error nil)))
981
982 (defun vc-cvs-status-extra-headers (dir)
983 "Extract and represent per-directory properties of a CVS working copy."
984 (let ((repo
985 (condition-case nil
986 (with-temp-buffer
987 (insert-file-contents "CVS/Root")
988 (goto-char (point-min))
989 (and (looking-at ":ext:") (delete-char 5))
990 (buffer-substring (point) (1- (point-max))))
991 (file-error nil)))
992 (module
993 (condition-case nil
994 (with-temp-buffer
995 (insert-file-contents "CVS/Repository")
996 (goto-char (point-min))
997 (re-search-forward "[^/\n]*" nil t)
998 (concat (match-string 0) "\n"))
999 (file-error nil))))
1000 (concat
1001 (cond (module
1002 (concat (propertize "Module : " 'face 'font-lock-type-face)
1003 (propertize module 'face 'font-lock-variable-name-face)))
1004 (t ""))
1005 (cond (repo
1006 (concat (propertize "Repository : " 'face 'font-lock-type-face)
1007 (propertize repo 'face 'font-lock-variable-name-face)))
1008 (t ""))
1009 ;; In CVS, branch is a per-file property, not a per-directory property.
1010 ;; We can't really do this here without making dangerous assumptions.
1011 ;;(propertize "Branch: " 'face 'font-lock-type-face)
1012 ;;(propertize "ADD CODE TO PRINT THE BRANCH NAME\n"
1013 ;; 'face 'font-lock-warning-face)
1014 )))
1015
1016 (defun vc-cvs-get-entries (dir)
1017 "Insert the CVS/Entries file from below DIR into the current buffer.
1018 This function ensures that the correct coding system is used for that,
1019 which may not be the one that is used for the files' contents.
1020 CVS/Entries should only be accessed through this function."
1021 (let ((coding-system-for-read (or file-name-coding-system
1022 default-file-name-coding-system)))
1023 (vc-insert-file (expand-file-name "CVS/Entries" dir))))
1024
1025 (defun vc-cvs-valid-symbolic-tag-name-p (tag)
1026 "Return non-nil if TAG is a valid symbolic tag name."
1027 ;; According to the CVS manual, a valid symbolic tag must start with
1028 ;; an uppercase or lowercase letter and can contain uppercase and
1029 ;; lowercase letters, digits, `-', and `_'.
1030 (and (string-match "^[a-zA-Z]" tag)
1031 (not (string-match "[^a-z0-9A-Z-_]" tag))))
1032
1033 (defun vc-cvs-valid-revision-number-p (tag)
1034 "Return non-nil if TAG is a valid revision number."
1035 (and (string-match "^[0-9]" tag)
1036 (not (string-match "[^0-9.]" tag))))
1037
1038 (defun vc-cvs-parse-sticky-tag (match-type match-tag)
1039 "Parse and return the sticky tag as a string.
1040 `match-data' is protected."
1041 (let ((data (match-data))
1042 (tag)
1043 (type (cond ((string= match-type "D") 'date)
1044 ((string= match-type "T")
1045 (if (vc-cvs-valid-symbolic-tag-name-p match-tag)
1046 'symbolic-name
1047 'revision-number))
1048 (t nil))))
1049 (unwind-protect
1050 (progn
1051 (cond
1052 ;; Sticky Date tag. Convert to a proper date value (`encode-time')
1053 ((eq type 'date)
1054 (string-match
1055 "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)"
1056 match-tag)
1057 (let* ((year-tmp (string-to-number (match-string 1 match-tag)))
1058 (month (string-to-number (match-string 2 match-tag)))
1059 (day (string-to-number (match-string 3 match-tag)))
1060 (hour (string-to-number (match-string 4 match-tag)))
1061 (min (string-to-number (match-string 5 match-tag)))
1062 (sec (string-to-number (match-string 6 match-tag)))
1063 ;; Years 0..68 are 2000..2068.
1064 ;; Years 69..99 are 1969..1999.
1065 (year (+ (cond ((> 69 year-tmp) 2000)
1066 ((> 100 year-tmp) 1900)
1067 (t 0))
1068 year-tmp)))
1069 (setq tag (encode-time sec min hour day month year))))
1070 ;; Sticky Tag name or revision number
1071 ((eq type 'symbolic-name) (setq tag match-tag))
1072 ((eq type 'revision-number) (setq tag match-tag))
1073 ;; Default is no sticky tag at all
1074 (t nil))
1075 (cond ((eq vc-cvs-sticky-tag-display nil) nil)
1076 ((eq vc-cvs-sticky-tag-display t)
1077 (cond ((eq type 'date) (format-time-string
1078 vc-cvs-sticky-date-format-string
1079 tag))
1080 ((eq type 'symbolic-name) tag)
1081 ((eq type 'revision-number) tag)
1082 (t nil)))
1083 ((functionp vc-cvs-sticky-tag-display)
1084 (funcall vc-cvs-sticky-tag-display tag type))
1085 (t nil)))
1086
1087 (set-match-data data))))
1088
1089 (defun vc-cvs-parse-entry (file &optional set-state)
1090 "Parse a line from CVS/Entries.
1091 Compare modification time to that of the FILE, set file properties
1092 accordingly. However, `vc-state' is set only if optional arg SET-STATE
1093 is non-nil."
1094 (cond
1095 ;; entry for a "locally added" file (not yet committed)
1096 ((looking-at "/[^/]+/0/")
1097 (vc-file-setprop file 'vc-checkout-time 0)
1098 (vc-file-setprop file 'vc-working-revision "0")
1099 (if set-state (vc-file-setprop file 'vc-state 'added)))
1100 ;; normal entry
1101 ((looking-at
1102 (concat "/[^/]+"
1103 ;; revision
1104 "/\\([^/]*\\)"
1105 ;; timestamp and optional conflict field
1106 "/\\([^/]*\\)/"
1107 ;; options
1108 "\\([^/]*\\)/"
1109 ;; sticky tag
1110 "\\(.\\|\\)" ;Sticky tag type (date or tag name, could be empty)
1111 "\\(.*\\)")) ;Sticky tag
1112 (vc-file-setprop file 'vc-working-revision (match-string 1))
1113 (vc-file-setprop file 'vc-cvs-sticky-tag
1114 (vc-cvs-parse-sticky-tag (match-string 4)
1115 (match-string 5)))
1116 ;; Compare checkout time and modification time.
1117 ;; This is intentionally different from the algorithm that CVS uses
1118 ;; (which is based on textual comparison), because there can be problems
1119 ;; generating a time string that looks exactly like the one from CVS.
1120 (let ((mtime (nth 5 (file-attributes file))))
1121 (require 'parse-time)
1122 (let ((parsed-time
1123 (parse-time-string (concat (match-string 2) " +0000"))))
1124 (cond ((and (not (string-match "\\+" (match-string 2)))
1125 (car parsed-time)
1126 (equal mtime (apply 'encode-time parsed-time)))
1127 (vc-file-setprop file 'vc-checkout-time mtime)
1128 (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
1129 (t
1130 (vc-file-setprop file 'vc-checkout-time 0)
1131 (if set-state (vc-file-setprop file 'vc-state 'edited)))))))))
1132
1133 ;; Completion of revision names.
1134 ;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use
1135 ;; `cvs log' so I can list all the revision numbers rather than only
1136 ;; tag names.
1137
1138 (defun vc-cvs-revision-table (file)
1139 (let ((default-directory (file-name-directory file))
1140 (res nil))
1141 (with-temp-buffer
1142 (vc-cvs-command t nil file "log")
1143 (goto-char (point-min))
1144 (when (re-search-forward "^symbolic names:\n" nil t)
1145 (while (looking-at "^ \\(.*\\): \\(.*\\)")
1146 (push (cons (match-string 1) (match-string 2)) res)
1147 (forward-line 1)))
1148 (while (re-search-forward "^revision \\([0-9.]+\\)" nil t)
1149 (push (match-string 1) res))
1150 res)))
1151
1152 (defun vc-cvs-revision-completion-table (files)
1153 (lexical-let ((files files)
1154 table)
1155 (setq table (lazy-completion-table
1156 table (lambda () (vc-cvs-revision-table (car files)))))
1157 table))
1158
1159
1160 (provide 'vc-cvs)
1161
1162 ;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
1163 ;;; vc-cvs.el ends here