# HG changeset patch # User FUJIWARA Katsunori # Date 2012-02-05 13:58:31 # Node ID 6a42846cf769027311931d00b099363f0310d73d # Parent 7e5a281a082cdbff4ae9553e01b5ff36dc2c11ee 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 --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -303,7 +303,7 @@ def standin(filename): # 2) Join with '/' because that's what dirstate always uses, even on # Windows. Change existing separator to '/' first in case we are # passed filenames from an external source (like the command line). - return shortname + '/' + filename.replace(os.sep, '/') + return shortname + '/' + util.pconvert(filename) def isstandin(filename): '''Return true if filename is a big file standin. filename must be @@ -314,7 +314,7 @@ def splitstandin(filename): # Split on / because that's what dirstate always uses, even on Windows. # Change local separator to / first just in case we are passed filenames # from an external source (like the command line). - bits = filename.replace(os.sep, '/').split('/', 1) + bits = util.pconvert(filename).split('/', 1) if len(bits) == 2 and bits[0] == shortname: return bits[1] else: @@ -433,7 +433,7 @@ def httpsendfile(ui, filename): def unixpath(path): '''Return a version of path normalized for use with the lfdirstate.''' - return os.path.normpath(path).replace(os.sep, '/') + return util.pconvert(os.path.normpath(path)) def islfilesrepo(repo): return ('largefiles' in repo.requirements and