Function: cvs-parsed-fileinfo

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

Signature

(cvs-parsed-fileinfo TYPE PATH &optional DIRECTORY &rest KEYS)

Documentation

Create a fileinfo.

TYPE can either be a type symbol or a cons of the form (TYPE . SUBTYPE). PATH is the filename. DIRECTORY influences the way PATH is interpreted:
- if a string, it denotes the directory in which PATH (which should then be
  a plain file name with no directory component) resides.
- if it's nil, the PATH should not be trusted: if it has a directory
  component, use it, else, assume it is relative to the current directory.
- else, the PATH should be trusted to be relative to the root directory
  (i.e. if there is no directory component, it means the file is inside
  the main directory).
The remaining KEYS are passed directly to cvs-create-fileinfo.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs-parse.el.gz
(defun cvs-parsed-fileinfo (type path &optional directory &rest keys)
  "Create a fileinfo.
TYPE can either be a type symbol or a cons of the form (TYPE . SUBTYPE).
PATH is the filename.
DIRECTORY influences the way PATH is interpreted:
- if a string, it denotes the directory in which PATH (which should then be
  a plain file name with no directory component) resides.
- if it's nil, the PATH should not be trusted: if it has a directory
  component, use it, else, assume it is relative to the current directory.
- else, the PATH should be trusted to be relative to the root directory
  (i.e. if there is no directory component, it means the file is inside
  the main directory).
The remaining KEYS are passed directly to `cvs-create-fileinfo'."
  (let ((dir directory)
	(file path))
    ;; only trust the directory if it's a string
    (unless (stringp directory)
      ;; else, if the directory is true, the path should be trusted
      (setq dir (or (file-name-directory path) (if directory "")))
      (setq file (file-name-nondirectory path)))

    (let ((type (if (consp type) (car type) type))
	  (subtype (if (consp type) (cdr type))))
      (when dir (setq cvs-current-dir dir))
      (apply #'cvs-create-fileinfo type
	     (concat cvs-current-subdir (or dir cvs-current-dir))
	     file (cvs-parse-msg) :subtype subtype keys))))