Patchwork [2,of,3] use new function ui.disppath in existing places

login
register
mail settings
Submitter Simon Heimberg
Date March 20, 2013, 10:39 a.m.
Message ID <bb678b1a26e52bcc390b.1363775977@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1141/
State Changes Requested, archived
Headers show

Comments

Simon Heimberg - March 20, 2013, 10:39 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1363775805 -3600
# Node ID bb678b1a26e52bcc390bb4f48896a1ed1db3bc35
# Parent  1b3fe856c993907ba4e14663e8c293f4f32333e8
use new function ui.disppath in existing places

Patch

diff -r 1b3fe856c993 -r bb678b1a26e5 mercurial/commands.py
--- a/mercurial/commands.py	Mit Mär 20 11:36:43 2013 +0100
+++ b/mercurial/commands.py	Mit Mär 20 11:36:45 2013 +0100
@@ -2505,9 +2505,7 @@ 
     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)
+    f = ui.disppath
     fmt = 'f  %%-%ds  %%-%ds  %%s' % (
         max([len(abs) for abs in items]),
         max([len(m.rel(abs)) for abs in items]))
diff -r 1b3fe856c993 -r bb678b1a26e5 mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mit Mär 20 11:36:43 2013 +0100
+++ b/mercurial/dirstate.py	Mit Mär 20 11:36:45 2013 +0100
@@ -131,10 +131,6 @@ 
         return ignore.ignore(self._root, files, self._ui.warn)
 
     @propertycache
-    def _slash(self):
-        return self._ui.configbool('ui', 'slash') and os.sep != '/'
-
-    @propertycache
     def _checklink(self):
         return util.checklink(self._root)
 
@@ -200,9 +196,7 @@ 
         if cwd is None:
             cwd = self.getcwd()
         path = util.pathto(self._root, cwd, f)
-        if self._slash:
-            return util.normpath(path)
-        return path
+        return self._ui.disppath(path)
 
     def __getitem__(self, key):
         '''Return the current state of key (a filename) in the dirstate.