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

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

Comments

Siddharth Agarwal - April 2, 2015, 2:48 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1427873167 25200
#      Wed Apr 01 00:26:07 2015 -0700
# Node ID 601b51ac7b5dbd6e37503430bfc4c208ae33b962
# Parent  42a1040af0c362b38ce45fc71e065d1769902c79
posix: 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
@@ -200,6 +200,11 @@  def samedevice(fpath1, fpath2):
 def normcase(path):
     return path.lower()
 
+# what normcase does to ASCII strings
+normcaseasciispec = encoding.normcaseasciispecs.lower
+# fallback normcase function for non-ASCII strings
+normcasefallback = normcase
+
 if sys.platform == 'darwin':
 
     def normcase(path):