[PATCH 1 of 2] debugwalk: observe ui.slash config option

Adrian Buehlmann adrian at cadifra.com
Mon Jun 11 04:24:58 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1339406114 -7200
# Node ID 5670fe8f8e3a63b18767ee38f55a14b847356e71
# Parent  f2719b38738074324c2d2d81be481f05c7e431cb
debugwalk: observe ui.slash config option

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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',


More information about the Mercurial-devel mailing list