Function: vc-dir-recompute-file-state

vc-dir-recompute-file-state is a byte-compiled function defined in vc-dir.el.gz.

Signature

(vc-dir-recompute-file-state FNAME DEF-DIR)

Documentation

Compute state of FNAME known to live inside DEF-DIR.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-dir.el.gz
(defun vc-dir-recompute-file-state (fname def-dir)
  "Compute state of FNAME known to live inside DEF-DIR."
  (let ((fname-short (file-relative-name fname def-dir)))
    (when (eq vc-dir-backend 'CVS)
      ;; FIXME: Warning: UGLY HACK.  The CVS backend caches the state
      ;; info, this forces the backend to update it.
      (vc-call-backend vc-dir-backend 'registered fname))
    (let* ((default-directory def-dir)
           (state (vc-call-backend vc-dir-backend 'state fname-short))
           (extra (vc-call-backend vc-dir-backend
                                   'status-fileinfo-extra fname-short)))
      ;; Ensure we return a nil state if the file does not exist and is
      ;; not tracked so that it disappears from VC-Dir (bug#81191).
      (if (and (eq state 'up-to-date) (not (file-exists-p fname)))
          (list fname-short nil nil)
        (list fname-short state extra)))))