Function: cvs-parse-process

cvs-parse-process is a byte-compiled function defined in pcvs.el.gz.

Signature

(cvs-parse-process DCD &optional SUBDIR OLD-FIS)

Documentation

Parse the output of a cvs process.

DCD is the dont-change-disc flag to use when parsing that output. SUBDIR is the subdirectory (if any) where this command was run. OLD-FIS is the list of fileinfos on which the cvs command was applied and
  which should be considered up-to-date if they are missing from the output.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs.el.gz
(defun cvs-parse-process (dcd &optional subdir old-fis)
  "Parse the output of a cvs process.
DCD is the `dont-change-disc' flag to use when parsing that output.
SUBDIR is the subdirectory (if any) where this command was run.
OLD-FIS is the list of fileinfos on which the cvs command was applied and
  which should be considered up-to-date if they are missing from the output."
  (when (eq system-type 'darwin)
    ;; Fixup the ^D^H^H inserted at beginning of buffer sometimes on macOS
    ;; because of the call to `process-send-eof'.
    (save-excursion
      (goto-char (point-min))
      (while (re-search-forward "^\\^D\^H+" nil t)
	(let ((inhibit-read-only t))
	  (delete-region (match-beginning 0) (match-end 0))))))
  (let* ((fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir))
	 last)
    (with-current-buffer cvs-buffer
      ;; Expand OLD-FIS to actual files.
      (let ((fis nil))
	(dolist (fi old-fis)
	  (setq fis (if (eq (cvs-fileinfo->type fi) 'DIRCHANGE)
			(nconc (ewoc-collect cvs-cookies 'cvs-dir-member-p
					     (cvs-fileinfo->dir fi))
			       fis)
		      (cons fi fis))))
	(setq old-fis fis))
      ;; Drop OLD-FIS which were already up-to-date.
      (let ((fis nil))
	(dolist (fi old-fis)
	  (unless (eq (cvs-fileinfo->type fi) 'UP-TO-DATE) (push fi fis)))
	(setq old-fis fis))
      ;; Add the new fileinfos to the ewoc.
      (dolist (fi fileinfos)
	(setq last (cvs-addto-collection cvs-cookies fi last))
	;; This FI was in the output, so remove it from OLD-FIS.
	(setq old-fis (delq (ewoc-data last) old-fis)))
      ;; Process the "silent output" (i.e. absence means up-to-date).
      (dolist (fi old-fis)
	(setf (cvs-fileinfo->type fi) 'UP-TO-DATE)
	(setq last (cvs-addto-collection cvs-cookies fi last)))
      (setq fileinfos (nconc old-fis fileinfos))
      ;; Clean up the ewoc as requested by the user.
      (cvs-cleanup-collection cvs-cookies
			      (eq cvs-auto-remove-handled t)
			      cvs-auto-remove-directories
			      nil)
      ;; Revert buffers if necessary.
      (when (and cvs-auto-revert (not dcd) (not cvs-from-vc))
	(cvs-revert-if-needed fileinfos)))))