[PATCH] revset: add 'only' revset

Durham Goode durham at fb.com
Fri Feb 28 13:43:55 CST 2014

On 2/28/14 9:29 AM, "Augie Fackler" <raf at durin42.com> wrote:

>On Wed, Feb 26, 2014 at 11:35:14AM -0800, Durham Goode wrote:
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1384621028 28800
>> #      Sat Nov 16 08:57:08 2013 -0800
>> # Node ID 9bcbd10a93137b4dbc83bebd41fb4f00143a7615
>> # Parent  0ad353831461516132f57ccda8e8e0515213ec60
>> revset: add 'only' revset
>Not crazy about the name, but seems reasonable.

I'm also not 100% happy.  Some other options I've considered:



The real appropriate name is 'branch()', but that's already taken for
other purposes.

>I had to think about this for a /long/ time to figure out that it's
>not ancestors(<set>). Can you figure out some clearer descriptions of
>this operator?
>> Adds a only() revset that has two forms:
>> only(<set>) is equivalent to "::<set> - ::(heads() - heads(<set>::))"
>> only(<include>,<exclude>) is equivalent to "::<include> - ::<exclude>"
>> On a large repo, this implementation can process/traverse 50,000 revs
>>in 0.7
>> seconds, versus 4.2 seconds using "::<include> - ::<exclude>".
>Hm. I wonder if we could do something to make - smarter so that it
>could auto-optimize that case? Probably too ambitious.

Sid made a commit earlier this month that did optimize it.  So ::<include>
- ::<exclude> is actually pretty fast now.  My commit message is just old

More information about the Mercurial-devel mailing list