[PATCH 3 of 6 foldmap-in-C] darwin: define normcase ASCII spec and fallback

Siddharth Agarwal sid0 at fb.com
Wed Apr 1 21:48:08 CDT 2015


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1427869819 25200
#      Tue Mar 31 23:30:19 2015 -0700
# Node ID ea8dd7ff10e7f46d1c83ce3a65d55e5c274bc6ff
# Parent  601b51ac7b5dbd6e37503430bfc4c208ae33b962
darwin: define normcase ASCII spec and fallback

These will be used in upcoming patches to efficiently create a dirstate
foldmap.

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -228,7 +228,11 @@ if sys.platform == 'darwin':
         try:
             return encoding.asciilower(path)  # exception for non-ASCII
         except UnicodeDecodeError:
-            pass
+            return normcasefallback(path)
+
+    normcaseasciispec = encoding.normcaseasciispecs.lower
+
+    def normcasefallback(path):
         try:
             u = path.decode('utf-8')
         except UnicodeDecodeError:


More information about the Mercurial-devel mailing list