Function: cvs-check-fileinfo

cvs-check-fileinfo is a byte-compiled function defined in pcvs-info.el.gz.

Signature

(cvs-check-fileinfo FI)

Documentation

Check FI's conformance to some conventions.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs-info.el.gz
;; Predicate:

(defun cvs-check-fileinfo (fi)
  "Check FI's conformance to some conventions."
  (let ((check 'none)
	(type (cvs-fileinfo->type fi))
	(subtype (cvs-fileinfo->subtype fi))
	(marked (cvs-fileinfo->marked fi))
	(dir (cvs-fileinfo->dir fi))
	(file (cvs-fileinfo->file fi))
	(base-rev (cvs-fileinfo->base-rev fi))
	(head-rev (cvs-fileinfo->head-rev fi))
	(full-log (cvs-fileinfo->full-log fi)))
    (if (and (setq check 'marked)	(memq marked '(t nil))
	     (setq check 'base-rev)	(or (null base-rev) (stringp base-rev))
	     (setq check 'head-rev)	(or (null head-rev) (stringp head-rev))
	     (setq check 'full-log)	(stringp full-log)
	     (setq check 'dir)
	     (and (stringp dir)
		  (not (file-name-absolute-p dir))
		  (or (string= dir "")
		      (string= dir (file-name-as-directory dir))))
	     (setq check 'file)
	     (and (stringp file)
		  (string= file (file-name-nondirectory file)))
	     (setq check 'type)		(symbolp type)
	     (setq check 'consistency)
	     (pcase type
	       ('DIRCHANGE (and (null subtype) (string= "." file)))
	       ((or 'NEED-UPDATE 'ADDED 'MISSING 'DEAD 'MODIFIED 'MESSAGE
                    'UP-TO-DATE 'REMOVED 'NEED-MERGE 'CONFLICT 'UNKNOWN)
		t)))
	fi
      (error "Invalid :%s in cvs-fileinfo %s" check fi))))