# HG changeset patch # User Shun-ichi GOTO # Date 2008-01-09 12:30:13 # Node ID 111ed8c871bffc3b7d8a65b397aed3cc689ee8f4 # Parent 07ca22a72dcc45dc3cfe939365827dfa3c74a639 Use util.normpath() instead of direct path string operation. This change is intended to allow hooking normpath() by win32mbcs extension for MBCS support. diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -53,7 +53,7 @@ def geturl(path): 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 @@ class svn_sink(converter_sink, commandli 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 diff --git a/mercurial/archival.py b/mercurial/archival.py --- a/mercurial/archival.py +++ b/mercurial/archival.py @@ -15,7 +15,7 @@ def tidyprefix(dest, prefix, suffixes): 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') diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -87,7 +87,7 @@ class dirstate(object): 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):