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

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

Comments

Siddharth Agarwal - April 2, 2015, 2:48 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1427873362 25200
#      Wed Apr 01 00:29:22 2015 -0700
# Node ID 134dd4b964369e65530f72f453937a52220ef3e7
# Parent  ea8dd7ff10e7f46d1c83ce3a65d55e5c274bc6ff
cygwin: define normcase ASCII spec and fallback

These will be used in upcoming patches to efficiently create a dirstate
foldmap.

The Cygwin normcase behavior is more complicated than just a simple lowercasing
or uppercasing. That's why we specify 'other'.

Patch

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -311,6 +311,9 @@  if sys.platform == 'cygwin':
 
         return encoding.upper(path)
 
+    normcaseasciispec = encoding.normcaseasciispecs.other
+    normcasefallback = normcase
+
     # Cygwin translates native ACLs to POSIX permissions,
     # but these translations are not supported by native
     # tools, so the exec bit tends to be set erroneously.