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

Siddharth Agarwal sid0 at fb.com
Thu Apr 2 17:51:52 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 ecef4c34ad58e5ec944f79d66559e684b56cfc0f
# Parent  15cdbfbc79cdb6866eef380e7c85129b8cf1092a
darwin: define normcase 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)
+
+    normcasespec = encoding.normcasespecs.lower
+
+    def normcasefallback(path):
         try:
             u = path.decode('utf-8')
         except UnicodeDecodeError:


More information about the Mercurial-devel mailing list