Function: vc-hg--working-branch

vc-hg--working-branch is a byte-compiled function defined in vc-hg.el.gz.

Signature

(vc-hg--working-branch)

Documentation

Return alist with currently active bookmark, if any, and current branch.

Keys into the alist are branch and bookmark, values are the name of the currently active bookmark (or nil) and the name of the current branch, as strings.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hg.el.gz
(defun vc-hg--working-branch ()
  "Return alist with currently active bookmark, if any, and current branch.
Keys into the alist are `branch' and `bookmark', values are the name of
the currently active bookmark (or nil) and the name of the current
branch, as strings."
  (with-temp-buffer
    (vc-hg-command t nil nil "summary")
    (goto-char (point-min))
    (re-search-forward "^branch: \\(.+\\)$")
    (let ((alist `((branch . ,(match-string 1)))))
      (goto-char (point-min))
      (if (re-search-forward "^bookmarks: \\*\\(\\S-+\\)" nil t)
          (cl-acons 'bookmark (match-string 1) alist)
        alist))))