mercurial/debugcommands.py
changeset 30524 1ee358c3ed26
parent 30519 20a42325fdef
child 30525 86ebd2f61c31
--- a/mercurial/debugcommands.py	Wed Nov 23 17:36:35 2016 +0000
+++ b/mercurial/debugcommands.py	Wed Aug 17 20:57:57 2016 -0700
@@ -26,6 +26,7 @@
     error,
     exchange,
     extensions,
+    fileset,
     hg,
     localrepo,
     lock as lockmod,
@@ -571,3 +572,16 @@
                  _('  bug reporting: %s\n'), extbuglink or "")
 
     fm.end()
+
+@command('debugfileset',
+    [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
+    _('[-r REV] FILESPEC'))
+def debugfileset(ui, repo, expr, **opts):
+    '''parse and apply a fileset specification'''
+    ctx = scmutil.revsingle(repo, opts.get('rev'), None)
+    if ui.verbose:
+        tree = fileset.parse(expr)
+        ui.note(fileset.prettyformat(tree), "\n")
+
+    for f in ctx.getfileset(expr):
+        ui.write("%s\n" % f)