# HG changeset patch # User Yuya Nishihara # Date 1497092615 -32400 # Node ID f78d210f599dcf59d1c5519256c892e2afa0f016 # Parent 6f775d10e83b928c99d5d6a7caa559c79fd925e1 debugrevspec: add option to print representation of smartset object It's possible by -v, but -v also prints a parsed tree. Test will be added later. diff -r 6f775d10e83b -r f78d210f599d mercurial/debugcommands.py --- a/mercurial/debugcommands.py Sat Jun 10 01:59:22 2017 +0100 +++ b/mercurial/debugcommands.py Sat Jun 10 20:03:35 2017 +0900 @@ -1901,6 +1901,7 @@ @command('debugrevspec', [('', 'optimize', None, _('print parsed tree after optimizing (DEPRECATED)')), + ('s', 'show-set', None, _('print internal representation of result set')), ('p', 'show-stage', [], _('print parsed tree at the given stage'), _('NAME')), ('', 'no-optimized', False, _('evaluate tree without optimization')), @@ -1962,9 +1963,9 @@ if opts['verify_optimized']: arevs = revset.makematcher(treebystage['analyzed'])(repo) brevs = revset.makematcher(treebystage['optimized'])(repo) - if ui.verbose: - ui.note(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n") - ui.note(("* optimized set:\n"), smartset.prettyformat(brevs), "\n") + if opts['show_set'] or (opts['show_set'] is None and ui.verbose): + ui.write(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n") + ui.write(("* optimized set:\n"), smartset.prettyformat(brevs), "\n") arevs = list(arevs) brevs = list(brevs) if arevs == brevs: @@ -1986,8 +1987,8 @@ func = revset.makematcher(tree) revs = func(repo) - if ui.verbose: - ui.note(("* set:\n"), smartset.prettyformat(revs), "\n") + if opts['show_set'] or (opts['show_set'] is None and ui.verbose): + ui.write(("* set:\n"), smartset.prettyformat(revs), "\n") for c in revs: ui.write("%s\n" % c) diff -r 6f775d10e83b -r f78d210f599d tests/test-completion.t --- a/tests/test-completion.t Sat Jun 10 01:59:22 2017 +0100 +++ b/tests/test-completion.t Sat Jun 10 20:03:35 2017 +0900 @@ -281,7 +281,7 @@ debugrebuildfncache: debugrename: rev debugrevlog: changelog, manifest, dir, dump - debugrevspec: optimize, show-stage, no-optimized, verify-optimized + debugrevspec: optimize, show-set, show-stage, no-optimized, verify-optimized debugsetparents: debugsub: rev debugsuccessorssets: