Function: cvs-mode-run

cvs-mode-run is a byte-compiled function defined in pcvs.el.gz.

Signature

(cvs-mode-run CMD FLAGS FIS &key (BUF (cvs-temp-buffer)) DONT-CHANGE-DISC CVSARGS POSTPROC)

Documentation

Generic cvs-mode-<foo> function.

Executes cvs CVSARGS CMD FLAGS FIS. BUF is the buffer to be used for cvs' output. DONT-CHANGE-DISC non-nil indicates that the command will not change the
  contents of files. This is only used by the parser.
POSTPROC is a function of no argument to be evaluated at the very end (after
  parsing if applicable).

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs.el.gz
(cl-defun cvs-mode-run (cmd flags fis
                        &key (buf (cvs-temp-buffer))
                             dont-change-disc cvsargs postproc)
  "Generic cvs-mode-<foo> function.
Executes `cvs CVSARGS CMD FLAGS FIS'.
BUF is the buffer to be used for cvs' output.
DONT-CHANGE-DISC non-nil indicates that the command will not change the
  contents of files.  This is only used by the parser.
POSTPROC is a function of no argument to be evaluated at the very end (after
  parsing if applicable)."
  (unless postproc (setq postproc #'ignore))
  (let ((def-dir default-directory))
    ;; Save the relevant buffers
    (save-some-buffers nil (lambda () (cvs-is-within-p fis def-dir))))
  (unless (listp flags) (error "Flags should be a list of strings"))
  ;; Some w32 versions of CVS don't like an explicit . too much.
  (when (and (car fis) (null (cdr fis))
	     (eq (cvs-fileinfo->type (car fis)) 'DIRCHANGE)
	     ;; (equal (cvs-fileinfo->file (car fis)) ".")
	     (equal (cvs-fileinfo->dir (car fis)) ""))
    (setq fis nil))
  (let* ((single-dir (or (not (listp cvs-execute-single-dir))
			 (member cmd cvs-execute-single-dir)))
	 (parse (member cmd cvs-parse-known-commands))
	 (args (append cvsargs (list cmd) flags))
	 (after-mode (nth 2 (cdr (assoc cmd cvs-buffer-name-alist)))))
    (cvs-cleanup-collection cvs-cookies ;cleanup remaining messages
			    (eq cvs-auto-remove-handled 'delayed) nil t)
    (when (fboundp after-mode)
      (setq postproc (let ((pp postproc))
                       (lambda () (funcall pp) (funcall after-mode)))))
    (when parse
      (let ((old-fis
	     (when (member cmd '("status" "update"))	;FIXME: Yuck!!
		;; absence of `cvs update' output has a specific meaning.
               (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." "")))))
            (pp postproc))
        (setq postproc (lambda ()
                         (cvs-parse-process dont-change-disc nil old-fis)
                         (funcall pp)))))
    (with-current-buffer buf
      (let ((inhibit-read-only t)) (erase-buffer))
      (message "Running cvs %s ..." cmd)
      (cvs-run-process args fis postproc single-dir))))