diff mercurial/merge.py @ 14980:28e98a8b173d stable

i18n: use UTF-8 string to lower filename for case collision check Some character sets, cp932 (known as Shift-JIS for Japanese) for example, use 0x41('A') - 0x5A('Z') and 0x61('a') - 0x7A('z') as second or later character. In such character set, case collision checking recognizes different files as CASEFOLDED same file, if filenames are treated as byte sequence. win32mbcs extension is not appropriate to handle this problem, because this problem can occur on other than Windows platform only if problematic character set is used. Callers of util.checkcase() use known ASCII filenames as last component of path, and string.lower() is not applied to directory part of path. So, util.checkcase() is kept intact, even though it applies string.lower() to filenames.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 28 Jul 2011 14:36:07 +0900
parents 88cb01c4575e
children 3afe5edda4e3
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Jul 22 20:31:15 2011 -0300
+++ b/mercurial/merge.py	Thu Jul 28 14:36:07 2011 +0900
@@ -7,7 +7,7 @@
 
 from node import nullid, nullrev, hex, bin
 from i18n import _
-import scmutil, util, filemerge, copies, subrepo
+import scmutil, util, filemerge, copies, subrepo, encoding
 import errno, os, shutil
 
 class mergestate(object):
@@ -92,7 +92,7 @@
     "check for case folding collisions in the destination context"
     folded = {}
     for fn in mctx:
-        fold = fn.lower()
+        fold = encoding.lower(fn)
         if fold in folded:
             raise util.Abort(_("case-folding collision between %s and %s")
                              % (fn, folded[fold]))