Use util.normpath() instead of direct path string operation.
authorShun-ichi GOTO <shunichi.goto@gmail.com>
Wed, 09 Jan 2008 21:30:13 +0900
changeset 5842 111ed8c871bf
parent 5841 07ca22a72dcc
child 5843 83c354c4d529
Use util.normpath() instead of direct path string operation. This change is intended to allow hooking normpath() by win32mbcs extension for MBCS support.
hgext/convert/subversion.py
mercurial/archival.py
mercurial/dirstate.py
--- a/hgext/convert/subversion.py	Fri Jan 11 14:06:05 2008 -0600
+++ b/hgext/convert/subversion.py	Wed Jan 09 21:30:13 2008 +0900
@@ -53,7 +53,7 @@
     if os.path.isdir(path):
         path = os.path.normpath(os.path.abspath(path))
         if os.name == 'nt':
-            path = '/' + path.replace('\\', '/')
+            path = '/' + util.normpath(path)
         return 'file://%s' % path
     return path
 
@@ -751,7 +751,7 @@
                               os.path.basename(path))
                     commandline(ui, 'svnadmin').run0('create', path)
                     created = path
-                path = path.replace('\\', '/')
+                path = util.normpath(path)
                 if not path.startswith('/'):
                     path = '/' + path
                 path = 'file://' + path
--- a/mercurial/archival.py	Fri Jan 11 14:06:05 2008 -0600
+++ b/mercurial/archival.py	Wed Jan 09 21:30:13 2008 +0900
@@ -15,7 +15,7 @@
     safe for consumers.'''
 
     if prefix:
-        prefix = prefix.replace('\\', '/')
+        prefix = util.normpath(prefix)
     else:
         if not isinstance(dest, str):
             raise ValueError('dest must be string if no prefix')
--- a/mercurial/dirstate.py	Fri Jan 11 14:06:05 2008 -0600
+++ b/mercurial/dirstate.py	Wed Jan 09 21:30:13 2008 +0900
@@ -87,7 +87,7 @@
             cwd = self.getcwd()
         path = util.pathto(self._root, cwd, f)
         if self._slash:
-            return path.replace(os.sep, '/')
+            return util.normpath(path)
         return path
 
     def __getitem__(self, key):