comparison mercurial/commands.py @ 17370:3fe199579323 stable

debugfileset: implement --rev, more tests
author Patrick Mezard <patrick@mezard.eu>
date Wed, 15 Aug 2012 22:28:32 +0200
parents e560ecb755fe
children 3738d6254bd3 45b5eb2941d0
comparison
equal deleted inserted replaced
17369:b360011a132d 17370:3fe199579323
1845 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, 1845 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches,
1846 opts.get('remote_head')) 1846 opts.get('remote_head'))
1847 localrevs = opts.get('local_head') 1847 localrevs = opts.get('local_head')
1848 doit(localrevs, remoterevs) 1848 doit(localrevs, remoterevs)
1849 1849
1850 @command('debugfileset', [], ('REVSPEC')) 1850 @command('debugfileset',
1851 def debugfileset(ui, repo, expr): 1851 [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
1852 _('[-r REV] FILESPEC'))
1853 def debugfileset(ui, repo, expr, **opts):
1852 '''parse and apply a fileset specification''' 1854 '''parse and apply a fileset specification'''
1855 ctx = scmutil.revsingle(repo, opts.get('rev'), None)
1853 if ui.verbose: 1856 if ui.verbose:
1854 tree = fileset.parse(expr)[0] 1857 tree = fileset.parse(expr)[0]
1855 ui.note(tree, "\n") 1858 ui.note(tree, "\n")
1856 1859
1857 for f in fileset.getfileset(repo[None], expr): 1860 for f in fileset.getfileset(ctx, expr):
1858 ui.write("%s\n" % f) 1861 ui.write("%s\n" % f)
1859 1862
1860 @command('debugfsinfo', [], _('[PATH]')) 1863 @command('debugfsinfo', [], _('[PATH]'))
1861 def debugfsinfo(ui, path = "."): 1864 def debugfsinfo(ui, path = "."):
1862 """show information detected about current filesystem""" 1865 """show information detected about current filesystem"""