Generating a mercurial branch diagram

Martin Geisler mg at aragost.com
Mon Apr 23 15:32:48 UTC 2012


Robert Cronk <cronk.r at gmail.com> writes:

Hi Robert,

I'm sending this reply to the Mercurial mailinglist too. This is where
normal user questions should go -- unless you're interested in paid
consulting offered by my company:

  http://aragost.com/mercurial/commercial-support/

> Martin,
>
> I have been searching the Internet to find a way to generate a branch
> diagram of a mercurial repository and for some reason haven't found
> it. I am even fine with just getting the branch names with its parent
> branch it branched off of and I can program the graphical
> representation of it myself if needed. We have both issue branches and
> stabilization branches and I'm interested only in the stabilization
> branches. I think I can filter the issue branches out by name.

I'm afraid I don't know of a tool that can do this out of the box. The
same thing was asked here today:

  http://stackoverflow.com/q/10280664/110204

There's no answers yet.

Another option is to write the tool yourself :) There are Mercurial
bindings for Python, Java, and Scala:

  http://mercurial.selenic.com/wiki/CommandServer#Libraries

> I saw that you were a core developer for mercurial and had answered
> some questions online for others so I figured I'd pose the question to
> you.

That's fine, but please use the mailinglist. That way your mail is
filtered correctly at my end and you'll likely get faster feedback since
more people see the question.

> I've tried looking at hgtk (tortoisehg) and I've tried revision sets
> on the command line to no avail. You can probably think of a way to do
> it easily that I've missed.

While TortoiseHg can draw nice graphs based on revision sets, it wont
connect changesets unless they are parent-child. So even if you can pick
out the right branch and merge points, you wont get a nice graph
connecting these points. You will just get a list of revisions with
unconnected dots.

As for finding the branch points, then I think this should help:

  hg log -r "parents(branch(B)) and not branch(B))"

It finds changesets outside the branch, but with a child on the branch.
They denote points in the graph where the branch started or where other
branches were merged into it.

> If you can help, I thank you in advance for taking the time to help me
> with this.
>
> Robert

-- 
Martin Geisler

aragost Trifork
Commercial Mercurial support
http://aragost.com/mercurial/



More information about the Mercurial mailing list