##// END OF EJS Templates
pathauditor: use normcase()-ed path for audit result cache...
FUJIWARA Katsunori -
r15664:ec873088 stable
parent child Browse files
Show More
@@ -81,12 +81,12 class pathauditor(object):
81 '''Check the relative path.
81 '''Check the relative path.
82 path may contain a pattern (e.g. foodir/**.txt)'''
82 path may contain a pattern (e.g. foodir/**.txt)'''
83
83
84 if path in self.audited:
84 normpath = os.path.normcase(path)
85 if normpath in self.audited:
85 return
86 return
86 # AIX ignores "/" at end of path, others raise EISDIR.
87 # AIX ignores "/" at end of path, others raise EISDIR.
87 if util.endswithsep(path):
88 if util.endswithsep(path):
88 raise util.Abort(_("path ends in directory separator: %s") % path)
89 raise util.Abort(_("path ends in directory separator: %s") % path)
89 normpath = os.path.normcase(path)
90 parts = util.splitpath(normpath)
90 parts = util.splitpath(normpath)
91 if (os.path.splitdrive(path)[0]
91 if (os.path.splitdrive(path)[0]
92 or parts[0].lower() in ('.hg', '.hg.', '')
92 or parts[0].lower() in ('.hg', '.hg.', '')
@@ -128,7 +128,7 class pathauditor(object):
128 prefixes.append(prefix)
128 prefixes.append(prefix)
129 parts.pop()
129 parts.pop()
130
130
131 self.audited.add(path)
131 self.audited.add(normpath)
132 # only add prefixes to the cache after checking everything: we don't
132 # only add prefixes to the cache after checking everything: we don't
133 # want to add "foo/bar/baz" before checking if there's a "foo/.hg"
133 # want to add "foo/bar/baz" before checking if there's a "foo/.hg"
134 self.auditeddir.update(prefixes)
134 self.auditeddir.update(prefixes)
General Comments 0
You need to be logged in to leave comments. Login now