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

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

Comments

Siddharth Agarwal - April 2, 2015, 10:51 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1427873362 25200
#      Wed Apr 01 00:29:22 2015 -0700
# Node ID 29fdd81a2553fb8e4a493ee2706bd7a22df890d0
# Parent  ecef4c34ad58e5ec944f79d66559e684b56cfc0f
cygwin: define normcase 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)
 
+    normcasespec = encoding.normcasespecs.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.