[PATCH 10 of 13 STABLE V4] windows: use upper() instead of lower() or os.path.normcase()

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Dec 16 06:27:18 CST 2011


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1324037380 -32400
# Branch stable
# Node ID 2807ba2d05cd7bb7d7b08c12a736c6662ad5a8ed
# Parent  0ff8a29782b7b8d85f8dcd4a74d4b8a36773ecb6
windows: use upper() instead of lower() or os.path.normcase()

this patch uses upper() instead of lower() or os.path.normcase() for
case folding on Windows(NTFS), because lower-ing causes problems for
some languages on it.

see below for detail about problem of lower-ing:

    https://blogs.msdn.com/b/michkap/archive/2005/01/16/353873.aspx

diff -r 0ff8a29782b7 -r 2807ba2d05cd hgext/win32mbcs.py
--- a/hgext/win32mbcs.py	Fri Dec 16 21:09:40 2011 +0900
+++ b/hgext/win32mbcs.py	Fri Dec 16 21:09:40 2011 +0900
@@ -127,7 +127,9 @@
 # NOTE: os.path.dirname() and os.path.basename() are safe because
 #       they use result of os.path.split()
 funcs = '''os.path.join os.path.split os.path.splitext
- os.path.splitunc os.path.normpath os.path.normcase os.makedirs
+ os.path.splitunc os.path.normpath os.makedirs
+ mercurial.windows.normcase
+ mercurial.util.normcase
  mercurial.util.endswithsep mercurial.util.splitpath mercurial.util.checkcase
  mercurial.util.fspath mercurial.util.pconvert mercurial.util.normpath
  mercurial.util.checkwinfilename mercurial.util.checkosfilename'''
diff -r 0ff8a29782b7 -r 2807ba2d05cd mercurial/windows.py
--- a/mercurial/windows.py	Fri Dec 16 21:09:40 2011 +0900
+++ b/mercurial/windows.py	Fri Dec 16 21:09:40 2011 +0900
@@ -131,7 +131,8 @@
 def normpath(path):
     return pconvert(os.path.normpath(path))
 
-normcase = os.path.normcase
+def normcase(path):
+    return path.upper()
 
 def realpath(path):
     '''


More information about the Mercurial-devel mailing list