[PATCH] revset: add experimental set subscript operator

Sean Farley sean at farley.io
Thu Jul 6 22:04:48 EDT 2017


Jun Wu <quark at fb.com> writes:

> Excerpts from Sean Farley's message of 2017-07-01 16:33:47 -0700:
>> > Yep. That's why I slightly prefer not using "{}".
>> >
>> >   $ hg log -T '{revset(".{0}")}\n'
>> >                          ^^^
>> >                    this is not a revset operator, but expanded to ''
>> 
>> I like separating {} and [] so that foo{4}[1] is the 4th level of
>> descendants of foo and the [1] would be the index in that list (ordered
>> by rev num?).
>
> Could it be foo[+4][1] meaning what you want? An explicit "+" means it's an
> offset, the "1" without a "+" means it's a normal index.

Hmmm, I'll have to mull on that. My gut feeling is that it might be too
magical. Though, we're severely limited on characters so it might be the
least-worst option.
-------------- 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/20170706/185a67d2/attachment.sig>


More information about the Mercurial-devel mailing list