Finding Merges in the Wrong Direction

Jensen, Aaron ajensen at webmd.net
Tue Nov 12 13:44:13 CST 2013


> We only cache the locations of the heads of X and Y (ie the last two here). 
> The only way to find the first Y.. might involve visiting a lot of changesets.

That's what I was afraid of.


> first(::X - ::default)

This doesn't work in our topology.  It returns no results. Sad trombone.

It turns out I have to have a descendants clause, otherwise it looks back too far and returns non-branch merges.  I'll use tags (e.g. XBaseline) to mark the point where a named branch begins, then I can just use:

	XBaseline:: and merge() and ::X

And now the query is down to about 1.5 seconds. Here's my final revset query:

    limit(children(p2(XBaseline:: and ::X and merge()) and branch(default)) and reverse(ancestors(2013B)))

Thanks for the help. It made a big difference.

     <:> Aaron



More information about the Mercurial mailing list