Mercurial > public > mercurial-scm > hg
diff mercurial/debugcommands.py @ 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 | 23734c0e361f |
children | bcca357bb792 |
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)