[PATCH 0 of 2] add the template keyword 'children'

Jason Harris jason at jasonfharris.com
Thu Jul 22 16:48:24 CDT 2010


On Jul 22, 2010, at 11:13 PM, Dan Villiom Podlaski Christiansen wrote:

> On 22 Jul 2010, at 22:24, Martin Geisler wrote:
> 
>> jfh <jason at jasonfharris.com> writes:
>> 
>>> This patch adds the template keyword 'children'.
>> 
>> Sure, I like the symmetri of this. Pushed to crew as 6faf015e0ba0 and
>> 83eb6b1465bf.
> 
> Erm, this may not be as good an idea as it seems, as the symmetry is deceptive. Whereas changectx.parents() is available in the revlog, changectx.children() inspects all changesets following the one called, to see if they are a child.
> 
> If children is added to a template, and it's used log all revisions in a repository, log has suddenly gone from O(n) to O(n^2). Although this may not matter in most cases, it can make a *huge* difference for large repositories.


Hmmm....

Hmmm....

I did this because I needed it in MacHg. I totally rewrote the way the graph log drawing is done in MacHg to make the drawing stable when you scroll around in the log, to do that I needed both the children and the parents. Its working quite well now in my development version. However its fairly essential to have this information when I start out drawing since if this information changes after some of the columns are drawn etc then thing can shift depending on "opps, now a child has appeared that we didn't know about..."

Would it be possible to internally cache this information at the Mercurial level so it could be only O(n). I know next to nothing about revlog's but could it be stored somewhere in there or somewhere else?

Thanks,
  Jason



More information about the Mercurial-devel mailing list