mercurial/debugcommands.py
changeset 38802 f0a574dbfae9
parent 38801 1d1c1645d7b9
child 38805 b9162ea1b815
--- 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