Function: vc-working-revision

vc-working-revision is a byte-compiled function defined in vc-hooks.el.gz.

Signature

(vc-working-revision FILE &optional BACKEND)

Documentation

Return the repository version from which FILE was checked out.

If FILE is not registered, this function always returns nil.

This function does not return nil without first confirming with the underlying VCS that FILE is unregistered; this is in contrast to vc-symbolic-working-revision.

Aliases

ediff-vc-working-revision (obsolete since 28.1)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hooks.el.gz
(defun vc-working-revision (file &optional backend)
  "Return the repository version from which FILE was checked out.
If FILE is not registered, this function always returns nil.

This function does not return nil without first confirming with the
underlying VCS that FILE is unregistered; this is in contrast to
`vc-symbolic-working-revision'."
  (or (vc-file-getprop file 'vc-working-revision)
      (let ((default-directory (file-name-directory file)))
        (and (setq backend (or backend (vc-backend file)))
             (vc-file-setprop file 'vc-working-revision
                              (vc-call-backend backend 'working-revision
                                               file))))))