[PATCH 2 of 4 STABLE] i18n: use util.pconvert() instead of 'str.replace()' for problematic encoding

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sun Feb 5 08:39:42 CST 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1328450311 -32400
# Branch stable
# Node ID 467a85ced564bb4d6f84eec743841b53c720b517
# Parent  6a42846cf769027311931d00b099363f0310d73d
i18n: use util.pconvert() instead of 'str.replace()' for problematic encoding

some problematic encodings use backslash as part of multi-byte characters.

util.pconvert() can treat strings in such encodings correctly, if
win32mbcs is enabled, but str.replace() can not.

diff -r 6a42846cf769 -r 467a85ced564 hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Sun Feb 05 22:58:31 2012 +0900
+++ b/hgext/convert/subversion.py	Sun Feb 05 22:58:31 2012 +0900
@@ -197,7 +197,7 @@
         proto = 'file'
         path = os.path.abspath(url)
     if proto == 'file':
-        path = path.replace(os.sep, '/')
+        path = util.pconvert(path)
     check = protomap.get(proto, lambda *args: False)
     while '/' in path:
         if check(ui, path, proto):


More information about the Mercurial-devel mailing list