Function: vc-hg-prepare-patch

vc-hg-prepare-patch is a byte-compiled function defined in vc-hg.el.gz.

Signature

(vc-hg-prepare-patch REV)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hg.el.gz
(defun vc-hg-prepare-patch (rev)
  (with-current-buffer (generate-new-buffer " *vc-hg-prepare-patch*")
    (vc-hg-command t 0 nil "export" "--git" "--rev" rev)
    (condition-case _
        (let (subject patch-start)
          (goto-char (point-min))
          (re-search-forward "^[^#].*")
          (setq subject (match-string 0))
          (re-search-forward "\n\ndiff --git a/")
          (setq patch-start (pos-bol))
          (list :subject subject
                :patch-start patch-start
                :buffer (current-buffer)))
      (search-failed (error "'hg export' output parse failure")))))