##// END OF EJS Templates
pathutil: use `finddirs_rev_noroot` instead of `parts`...
Arseniy Alekseyev -
r50803:789e152a default
parent child Browse files
Show More
@@ -107,14 +107,12 b' class pathauditor:'
107 )
107 )
108
108
109 if self._realfs:
109 if self._realfs:
110 parts.pop()
111 # It's important that we check the path parts starting from the root.
110 # It's important that we check the path parts starting from the root.
112 # We don't want to add "foo/bar/baz" to auditeddir before checking if
111 # We don't want to add "foo/bar/baz" to auditeddir before checking if
113 # there's a "foo/.hg" directory. This also means we won't accidentally
112 # there's a "foo/.hg" directory. This also means we won't accidentally
114 # traverse a symlink into some other filesystem (which is potentially
113 # traverse a symlink into some other filesystem (which is potentially
115 # expensive to access).
114 # expensive to access).
116 for i in range(len(parts)):
115 for prefix in finddirs_rev_noroot(path):
117 prefix = pycompat.ossep.join(parts[: i + 1])
118 if prefix in self.auditeddir:
116 if prefix in self.auditeddir:
119 res = self.auditeddir[prefix]
117 res = self.auditeddir[prefix]
120 else:
118 else:
General Comments 0
You need to be logged in to leave comments. Login now