changeset 15666:37a6e9765015 stable

pathauditor: switch normcase logic according to case sensitivity of filesystem this patch applies 'util.normcase()' to audit path only on case insensitive filesystem.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 16 Dec 2011 21:09:40 +0900
parents 081e795c60e0
children eacfd851cb9e
files mercurial/scmutil.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.