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

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

Comments

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