Configuration

.hgrc

To use pbranch, you need to enable it as a Mercurial extension in an hgrc file. It depends on the graphlog extension, so you should have (and probably enable) the latter as well. We also enable mq here to show how pbranch interoperates with mq.

$ cat >~/.hgrc <<-eof
    [extensions]
    hgext.pbranch =
    hgext.graphlog =
    hgext.mq =
eof

For this demo environment, I need a few more settings, though. In particular, I shall be using git-style diffs with no context and a one-line default log template to keep the demo output concise. I also turn off interactive merging so I can run the demo from a script:

$ cat >>~/.hgrc <<-eof
    [defaults]
    pdiff = --git --unified 0
    pemail = --git --unified 0
    pexport = --git --unified 0
    diff = --git --unified 0
    commit = --date '0 0'
    pnew = --date '0 0'
    pmerge = --date '0 0'
    peditmessage = --date '0 0'

    [ui]
    username = john
    logtemplate = "{rev}\t{branches}: {desc|firstline} - {author|user}\n" 
    merge = internal:merge
    editor = cat
eof

To check the setup, run:

$ hg help pbranch
pbranch extension - manages evolving patches as topic branches (an alternative
to mq)
_
This extension lets you develop patches collaboratively in special topic
branches of temporary clones of the main repository.
_
For more information:
http://www.selenic.com/mercurial/wiki/index.cgi/PatchBranchExtension
_
list of commands:
_
 pbackout      backs out the current patch branch (undoes all its changes)
 pdiff         prints the final diff for the current or given patch branch
 peditmessage  edit the patch message
 pemail        send patches by email
 pexport       exports patches
 pgraph        print an ASCII art rendering of the patch dependency graph
 pmerge        merge pending heads from dependencies into patch branches
 pmessage      print the patch message(s)
 pnew          start a new patch branch
 pstatus       print status of current (or given) patch branch
 reapply       reverts the working copy of all files touched by REV to REV
_
use "hg -v help pbranch" to show builtin aliases and global options