Differences between revisions 1 and 2
Revision 1 as of 2014-11-07 18:15:16
Size: 875
Editor: Sean Farley
Comment: init
Revision 2 as of 2014-11-07 19:05:59
Size: 1444
Editor: Sean Farley
Comment: add current operators
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
With new revset functions comes new workflows and the desire to quickly enter them. This page serves as a discussion for proposed operators. Current unused single ASCII characters that could be used: 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:
Line 8: Line 20:
#$%*=[]{}\/,<> %
=
{
}
/
,
?
}}}

Other candidates,

{{{
#
$
\
[
]
;
_
Line 22: Line 52:
Another operator could be `\` (as in set difference from mathematics),

{{{
only(.,@) → .\\@
only(@) → @\\
}}}
Line 25: Line 62:

== next() ==

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

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:

%
=
{
}
/
,
?

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)