diff -r 1d1c1645d7b9 -r f0a574dbfae9 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Sat Jul 21 14:52:36 2018 +0900 +++ b/mercurial/debugcommands.py Sat Jul 21 15:05:40 2018 +0900 @@ -889,6 +889,8 @@ [('r', 'rev', '', _('apply the filespec on this revision'), _('REV')), ('', 'all-files', False, _('test files from all revisions and working directory')), + ('s', 'show-matcher', None, + _('print internal representation of matcher')), ('p', 'show-stage', [], _('print parsed tree at the given stage'), _('NAME'))], _('[-r REV] [--all-files] [OPTION]... FILESPEC')) @@ -939,6 +941,8 @@ files.update(ctx.substate) m = ctx.matchfileset(expr) + if opts['show_matcher'] or (opts['show_matcher'] is None and ui.verbose): + ui.write(('* matcher:\n'), stringutil.prettyrepr(m), '\n') for f in sorted(files): if not m(f): continue