debugwalk: observe ui.slash config option
authorAdrian Buehlmann <adrian@cadifra.com>
Mon, 11 Jun 2012 11:15:14 +0200
changeset 16953 634ad0b24ba2
parent 16951 bdf8c6c61c9b
child 16954 8f36806b8f6a
debugwalk: observe ui.slash config option
mercurial/commands.py
--- a/mercurial/commands.py	Wed Jun 13 20:14:28 2012 +0200
+++ b/mercurial/commands.py	Mon Jun 11 11:15:14 2012 +0200
@@ -2371,11 +2371,14 @@
     items = list(repo.walk(m))
     if not items:
         return
+    f = lambda fn: fn
+    if ui.configbool('ui', 'slash') and os.sep != '/':
+        f = lambda fn: util.normpath(fn)
     fmt = 'f  %%-%ds  %%-%ds  %%s' % (
         max([len(abs) for abs in items]),
         max([len(m.rel(abs)) for abs in items]))
     for abs in items:
-        line = fmt % (abs, m.rel(abs), m.exact(abs) and 'exact' or '')
+        line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
         ui.write("%s\n" % line.rstrip())
 
 @command('debugwireargs',