Mercurial > hg
changeset 32796:f78d210f599d
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.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 10 Jun 2017 20:03:35 +0900 |
parents | 6f775d10e83b |
children | bcca357bb792 |
files | mercurial/debugcommands.py tests/test-completion.t |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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: