# HG changeset patch # User Yuya Nishihara # Date 2016-08-07 06:01:42 # Node ID 104914b03b834d105f410c45d5486742758ade2f # Parent b1ebc767563d95db3dfff69a17f155a1f3fd93c0 revset: make optimize() reject unknown operators This should have caught the bug of 'keyvalue' operator fixed at 5004ef47f437. The catch-all pattern is useless since optimize() should be aware of all known operators. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2463,7 +2463,7 @@ def _optimize(x, small): else: w = 1 return w + wa, (op, x[1], ta) - return 1, x + raise ValueError('invalid operator %r' % op) def optimize(tree): _weight, newtree = _optimize(tree, small=True)