diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3515,6 +3515,7 @@ def debugrevlog(ui, repo, file_=None, ** _('print parsed tree after optimizing (DEPRECATED)')), ('p', 'show-stage', [], _('print parsed tree at the given stage'), _('NAME')), + ('', 'no-optimized', False, _('evaluate tree without optimization')), ], ('REVSPEC')) def debugrevspec(ui, repo, expr, **opts): @@ -3530,6 +3531,8 @@ def debugrevspec(ui, repo, expr, **opts) ('analyzed', revset.analyze), ('optimized', revset.optimize), ] + if opts['no_optimized']: + stages = stages[:-1] stagenames = set(n for n, f in stages) showalways = set() diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -269,7 +269,7 @@ Show all commands + options debugrebuildfncache: debugrename: rev debugrevlog: changelog, manifest, dir, dump - debugrevspec: optimize, show-stage + debugrevspec: optimize, show-stage, no-optimized debugsetparents: debugsub: rev debugsuccessorssets: diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -508,6 +508,21 @@ parsed tree at stages: hg: parse error: missing argument [255] + $ hg debugrevspec --no-optimized -p all '()' + * parsed: + (group + None) + * expanded: + (group + None) + * concatenated: + (group + None) + * analyzed: + None + hg: parse error: missing argument + [255] + $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1' * parsed: (minus @@ -2058,6 +2073,32 @@ test optimization of trivial `or` operat 5 6 +unoptimized `or` looks like this + + $ try --no-optimized -p analyzed '0|1|2|3|4' + * analyzed: + (or + ('symbol', '0') + ('symbol', '1') + ('symbol', '2') + ('symbol', '3') + ('symbol', '4')) + * set: + , + >, + , + , + >>> + 0 + 1 + 2 + 3 + 4 + test that `_list` should be narrowed by provided `subset` $ log '0:2 and (null|1|2|3)'