diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2094,7 +2094,6 @@ methods = { "ancestor": ancestorspec, "parent": parentspec, "parentpost": p1, - "only": only, } def optimize(x, small): diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -615,6 +615,24 @@ Test opreand of '%' is optimized recursi 8 9 + $ try --optimize '(9)%(5)' + (only + (group + ('symbol', '9')) + (group + ('symbol', '5'))) + * optimized: + (func + ('symbol', 'only') + (list + ('symbol', '9') + ('symbol', '5'))) + * set: + + 2 + 4 + 8 + 9 Test the order of operations