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

login
register
mail settings
Submitter Siddharth Agarwal
Date April 2, 2015, 2:48 a.m.
Message ID <ea8dd7ff10e7f46d1c83.1427942888@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8438/
State Rejected
Headers show

Comments

Siddharth Agarwal - April 2, 2015, 2:48 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.

Patch

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: