comparison mercurial/commands.py @ 16953:634ad0b24ba2

debugwalk: observe ui.slash config option
author Adrian Buehlmann <adrian@cadifra.com>
date Mon, 11 Jun 2012 11:15:14 +0200
parents 66721a0d2249
children 1dbe8a2b1b96
comparison
equal deleted inserted replaced
16951:bdf8c6c61c9b 16953:634ad0b24ba2
2369 """show how files match on given patterns""" 2369 """show how files match on given patterns"""
2370 m = scmutil.match(repo[None], pats, opts) 2370 m = scmutil.match(repo[None], pats, opts)
2371 items = list(repo.walk(m)) 2371 items = list(repo.walk(m))
2372 if not items: 2372 if not items:
2373 return 2373 return
2374 f = lambda fn: fn
2375 if ui.configbool('ui', 'slash') and os.sep != '/':
2376 f = lambda fn: util.normpath(fn)
2374 fmt = 'f %%-%ds %%-%ds %%s' % ( 2377 fmt = 'f %%-%ds %%-%ds %%s' % (
2375 max([len(abs) for abs in items]), 2378 max([len(abs) for abs in items]),
2376 max([len(m.rel(abs)) for abs in items])) 2379 max([len(m.rel(abs)) for abs in items]))
2377 for abs in items: 2380 for abs in items:
2378 line = fmt % (abs, m.rel(abs), m.exact(abs) and 'exact' or '') 2381 line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
2379 ui.write("%s\n" % line.rstrip()) 2382 ui.write("%s\n" % line.rstrip())
2380 2383
2381 @command('debugwireargs', 2384 @command('debugwireargs',
2382 [('', 'three', '', 'three'), 2385 [('', 'three', '', 'three'),
2383 ('', 'four', '', 'four'), 2386 ('', 'four', '', 'four'),