Differences between revisions 2 and 3
Revision 2 as of 2014-11-07 19:05:59
Size: 1444
Editor: Sean Farley
Comment: add current operators
Revision 3 as of 2014-11-11 11:48:52
Size: 1515
Comment: annotated: not so good operator.
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
%
Line 25: Line 25:
,
?
% (bad for windows)
? (interpreted by bash)
, (already used in function)

Note:

This page is primarily intended for developers of Mercurial.

Revset Operators Plan

With new revset functions comes new workflows and the desire to quickly enter them. This page serves as a discussion for proposed operators. Currently, we have the following operators:

Operator

Function

!

not

::

DAG

:

range

&

and

|

or

-

set difference

^

parent

~

ancestor

Good candidates (i.e. not needing annoying shell escaping) for new operators:

=
{
}
/
% (bad for windows)
? (interpreted by bash)
, (already used in function)

Other candidates,

#
$
\
[
]
;
_

One possibility is that we could have two character operators.

only()

This function is extremely handy and allows a quick way to view your current branch. The suggested operator is % (as in mod) though it might make more sense to use a set difference operator. For example,

only(.,@) → .%@
only(@) → @%

Another operator could be \ (as in set difference from mathematics),

only(.,@) → .\\@
only(@) → @\\

children()

Navigating history is much easier if there is a way to say 'first child'. One proposal was to overload the parent operator ^ to use negative numbers but that could led to confusion since children are not defined to have an order.

next()

This function does not yet exist but it could possibly provide the convenience of a child operator.

RevsetOperatorPlan (last edited 2017-05-31 03:55:15 by Sean Farley)