pathauditor: switch normcase logic according to case sensitivity of filesystem stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 16 Dec 2011 21:09:40 +0900
branchstable
changeset 15666 37a6e9765015
parent 15665 081e795c60e0
child 15667 eacfd851cb9e
pathauditor: switch normcase logic according to case sensitivity of filesystem this patch applies 'util.normcase()' to audit path only on case insensitive filesystem.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Fri Dec 16 21:09:40 2011 +0900
+++ b/mercurial/scmutil.py	Fri Dec 16 21:09:40 2011 +0900
@@ -76,12 +76,16 @@
         self.auditeddir = set()
         self.root = root
         self.callback = callback
+        if os.path.lexists(root) and not util.checkcase(root):
+            self.normcase = util.normcase
+        else:
+            self.normcase = lambda x: x
 
     def __call__(self, path):
         '''Check the relative path.
         path may contain a pattern (e.g. foodir/**.txt)'''
 
-        normpath = os.path.normcase(path)
+        normpath = self.normcase(path)
         if normpath in self.audited:
             return
         # AIX ignores "/" at end of path, others raise EISDIR.