comparison mercurial/debugcommands.py @ 30533:1ee358c3ed26

debugcommands: move 'debugfileset' in the new module
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 17 Aug 2016 20:57:57 -0700
parents 20a42325fdef
children 86ebd2f61c31
comparison
equal deleted inserted replaced
30532:726d30a6d89b 30533:1ee358c3ed26
24 dagparser, 24 dagparser,
25 dagutil, 25 dagutil,
26 error, 26 error,
27 exchange, 27 exchange,
28 extensions, 28 extensions,
29 fileset,
29 hg, 30 hg,
30 localrepo, 31 localrepo,
31 lock as lockmod, 32 lock as lockmod,
32 pycompat, 33 pycompat,
33 revlog, 34 revlog,
569 570
570 fm.condwrite(ui.verbose and extbuglink, 'buglink', 571 fm.condwrite(ui.verbose and extbuglink, 'buglink',
571 _(' bug reporting: %s\n'), extbuglink or "") 572 _(' bug reporting: %s\n'), extbuglink or "")
572 573
573 fm.end() 574 fm.end()
575
576 @command('debugfileset',
577 [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
578 _('[-r REV] FILESPEC'))
579 def debugfileset(ui, repo, expr, **opts):
580 '''parse and apply a fileset specification'''
581 ctx = scmutil.revsingle(repo, opts.get('rev'), None)
582 if ui.verbose:
583 tree = fileset.parse(expr)
584 ui.note(fileset.prettyformat(tree), "\n")
585
586 for f in ctx.getfileset(expr):
587 ui.write("%s\n" % f)