##// END OF EJS Templates
pathauditor: move file system specific check in their own function...
Pierre-Yves David -
r27231:6d29ce25 default
parent child Browse files
Show More
@@ -81,6 +81,18 b' class pathauditor(object):'
81 81 normprefix = os.sep.join(normparts)
82 82 if normprefix in self.auditeddir:
83 83 break
84 self._checkfs(prefix, path)
85 prefixes.append(normprefix)
86 parts.pop()
87 normparts.pop()
88
89 self.audited.add(normpath)
90 # only add prefixes to the cache after checking everything: we don't
91 # want to add "foo/bar/baz" before checking if there's a "foo/.hg"
92 self.auditeddir.update(prefixes)
93
94 def _checkfs(self, prefix, path):
95 """raise exception if a file system backed check fails"""
84 96 curpath = os.path.join(self.root, prefix)
85 97 try:
86 98 st = os.lstat(curpath)
@@ -98,16 +110,7 b' class pathauditor(object):'
98 110 os.path.isdir(os.path.join(curpath, '.hg'))):
99 111 if not self.callback or not self.callback(curpath):
100 112 raise error.Abort(_("path '%s' is inside nested "
101 "repo %r")
102 % (path, prefix))
103 prefixes.append(normprefix)
104 parts.pop()
105 normparts.pop()
106
107 self.audited.add(normpath)
108 # only add prefixes to the cache after checking everything: we don't
109 # want to add "foo/bar/baz" before checking if there's a "foo/.hg"
110 self.auditeddir.update(prefixes)
113 "repo %r") % (path, prefix))
111 114
112 115 def check(self, path):
113 116 try:
General Comments 0
You need to be logged in to leave comments. Login now