Mercurial > hg
comparison hgext/convert/subversion.py @ 16067:467a85ced564 stable
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 05 Feb 2012 22:58:31 +0900 |
parents | 9f2ed48f8cda |
children | d75aa756149b |
comparison
equal
deleted
inserted
replaced
16066:6a42846cf769 | 16067:467a85ced564 |
---|---|
195 path = urllib.url2pathname(path) | 195 path = urllib.url2pathname(path) |
196 except ValueError: | 196 except ValueError: |
197 proto = 'file' | 197 proto = 'file' |
198 path = os.path.abspath(url) | 198 path = os.path.abspath(url) |
199 if proto == 'file': | 199 if proto == 'file': |
200 path = path.replace(os.sep, '/') | 200 path = util.pconvert(path) |
201 check = protomap.get(proto, lambda *args: False) | 201 check = protomap.get(proto, lambda *args: False) |
202 while '/' in path: | 202 while '/' in path: |
203 if check(ui, path, proto): | 203 if check(ui, path, proto): |
204 return True | 204 return True |
205 path = path.rsplit('/', 1)[0] | 205 path = path.rsplit('/', 1)[0] |