Function: vc-cvs-checkout

vc-cvs-checkout is a byte-compiled function defined in vc-cvs.el.gz.

Signature

(vc-cvs-checkout FILE &optional REV)

Documentation

Checkout a revision of FILE into the working area.

REV is the revision to check out.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-cvs.el.gz
(defun vc-cvs-checkout (file &optional rev)
  "Checkout a revision of FILE into the working area.
REV is the revision to check out."
  (message "Checking out %s..." file)
  ;; Change buffers to get local value of vc-checkout-switches.
  (with-current-buffer (or (get-file-buffer file) (current-buffer))
    (if (and (file-exists-p file) (not rev))
        ;; If no revision was specified, just make the file writable
        ;; if necessary (using `cvs-edit' if requested).
        (and (not (eq (vc-cvs-checkout-model (list file)) 'implicit))
             (if vc-cvs-use-edit
                 (vc-cvs-command nil 0 file "edit")
               (set-file-modes file (logior (file-modes file) 128))
               (if (equal file buffer-file-name) (read-only-mode -1))))
      ;; Check out a particular revision (or recreate the file).
      (vc-file-setprop file 'vc-working-revision nil)
      (apply #'vc-cvs-command nil 0 file
             "-w"
             "update"
             (when rev
               (unless (eq rev t)
                 ;; default for verbose checkout: clear the
                 ;; sticky tag so that the actual update will
                 ;; get the head of the trunk
                 (if (string= rev "")
                     "-A"
                   (concat "-r" rev))))
             (vc-switches 'CVS 'checkout)))
    (vc-mode-line file 'CVS))
  (message "Checking out %s...done" file))