Function: vc-bzr-version-dirstate

vc-bzr-version-dirstate is a byte-compiled function defined in vc-bzr.el.gz.

Signature

(vc-bzr-version-dirstate DIR)

Documentation

Try to return as a string the bzr revision ID of directory DIR.

This uses the dirstate file's parent revision entry. Returns nil if unable to find this information.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-bzr.el.gz
(defun vc-bzr-version-dirstate (dir)
  "Try to return as a string the bzr revision ID of directory DIR.
This uses the dirstate file's parent revision entry.
Returns nil if unable to find this information."
  (let ((file (expand-file-name ".bzr/checkout/dirstate" dir)))
    (when (file-readable-p file)
      (with-temp-buffer
        (insert-file-contents file)
        (and (looking-at "#bazaar dirstate flat format 3")
             (forward-line 3)
             (looking-at "[0-9]+\0\\([^\0\n]+\\)\0")
             (match-string 1))))))