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

login
register
mail settings
Submitter Siddharth Agarwal
Date April 2, 2015, 10:51 p.m.
Message ID <ecef4c34ad58e5ec944f.1428015112@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8460/
State Accepted
Headers show

Comments

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

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)
+
+    normcasespec = encoding.normcasespecs.lower
+
+    def normcasefallback(path):
         try:
             u = path.decode('utf-8')
         except UnicodeDecodeError: