children, n^2 and solutions?

Matt Mackall mpm at selenic.com
Sun Jul 25 21:10:20 CDT 2010


On Mon, 2010-07-26 at 03:13 +0200, Jason Harris wrote:
> So I have looked into trying to make sure I do look aheads and caching
> at the right time, and then back looking, and then graph extensions
> when things change, and then redoing the graph extension layouts, and
> lots more details... and well its pretty painful... So at this stage I
> am wondering if it is possible to make Mercurial store the child
> information in the revlog or internally somewhere in a persistent way?
> Would this be insanely difficult?

It's actually impossible. All pointers in revlogs must point into the
past rather than the future. We could have a bag on the side to store
such things, but that'd be ugly and we internally have no need for it.

It should be a pretty simple matter to cache it all on your side. You
can, for instance, read out the complete history graph all in one go
like this:

hg debugindex .hg/store/00changelog.i

And there's a compact, faster form that works like this (1.6+):

hg debugdag

This'll dump the graph of my kernel repo (201733 csets) in less than
three seconds. See hg debugbuilddag for parsing info.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list