Generating a mercurial branch diagram
Martin Geisler
mg at aragost.com
Tue Apr 24 08:41:12 UTC 2012
Robert Cronk <cronk.r at gmail.com> writes:
> On Apr 23, 2012, at 3:46 PM, Angel Ezquerra <angel.ezquerra at gmail.com> wrote:
>
>> On Mon, Apr 23, 2012 at 5:32 PM, Martin Geisler <mg at aragost.com> wrote:
>>>
>>> <snip>
>>> 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
>>
>> I think that it should be possible and not too hard to generate a
>> graphviz file from the hg log output.
>>
>> If I recall correctly Matt was thinking about adding a flexible output
>> format which perhaps could be used for this once it is complete?
>>
>> Cheers,
>>
>> Angel
>
> Martin - thank you for your guidance. I apologize for contacting you
> directly. I'll use the email list from now on.
No problem, this happens all the time :)
> I tried your hg command and it appears to give me a parent branch for
> each branch I pass in. I should be able to build a tree with that
> pretty easily. I'll post the code if I do. It will be in python.
Cool! Note that if you only want to find the changeset where the branch
first branched off, then this is much faster:
p1(min(branch(B)))
> Angel - I'd like to take the tree from the code I'm about to write and
> push it into some sort of graphical generation library. When I do
> that, I'll post the code here. I'm getting into matplotlib lately, so
> I'll try that first unless someone thinks that's a bad idea.
Using matplotlib will give you full control, but you have to do the work
yourself. Graphviz has the advantage that it will do the graph layout
for you. That can also be a disadvantage if you don't agree with the
layout it generates! :)
--
Martin Geisler
aragost Trifork
Commercial Mercurial support
http://aragost.com/mercurial/
More information about the Mercurial
mailing list