[PATCH] revset: add experimental set subscript operator

Sean Farley sean at farley.io
Wed Jul 12 14:30:16 EDT 2017


Yuya Nishihara <yuya at tcha.org> writes:

> On Fri, 7 Jul 2017 08:26:53 -0700, Jun Wu wrote:
>> I'm currently leaning towards "outside the operator". That could make "[]"
>> closer to existing language. It also looks flexible and clean.  For example,
>> use "#ordertype", like:
>> 
>>   x#changelog[3]:  x~-3 (approximately)
>>   x#changelog[-3]: x~3 (approximately)
>>   x#changelog[0:3]: x + x~-1 + x~-2 + x~-3
>>   x#changelog[1:]: descendants(x) - x
>> 
>>   x#changeloglinear[-3]: x~3 (only consider p1 to make history linear)
>>   x#changeloglinear[:0]: _firstancestors(x)
>> 
>>   x#obsolete[1]: successors(x)
>>   x#obsolete[1:]: allsuccessors(x) - x 
>>   x#obsolete[:]: allprecursors(x) + allsuccessors(x)
>> 
>>   x#plainlist[1]: pick the second element in the list
>>   x#plainlist[-1]: pick the last element in the list
>>   x#plainlist[1:3]: pick a slice in the list
>
> Do we want this experimental feature in 4.3? The patches are mostly ready,
> but this is completely new operator, so I'm not sure.
>
>> Note: the names (changeloglinear etc.) here are just examples, not final.
>
> It's called as 'x#generations[n]' in my draft patch, could be abbreviated
> as 'x#g[n]' (and also remembered as 'g' for 'graph'.)

Is it worth putting behind a flag? Or can undocumented things (e.g.
wdir()) be "hidden" and changed later?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170712/7af6aed0/attachment.sig>


More information about the Mercurial-devel mailing list