##// END OF EJS Templates
pathauditor: preserve case in abort messages...
FUJIWARA Katsunori -
r15665:081e795c stable
parent child Browse files
Show More
@@ -87,7 +87,7 b' class pathauditor(object):'
87 # AIX ignores "/" at end of path, others raise EISDIR.
87 # AIX ignores "/" at end of path, others raise EISDIR.
88 if util.endswithsep(path):
88 if util.endswithsep(path):
89 raise util.Abort(_("path ends in directory separator: %s") % path)
89 raise util.Abort(_("path ends in directory separator: %s") % path)
90 parts = util.splitpath(normpath)
90 parts = util.splitpath(path)
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.', '')
93 or os.pardir in parts):
93 or os.pardir in parts):
@@ -101,11 +101,16 b' class pathauditor(object):'
101 raise util.Abort(_('path %r is inside nested repo %r')
101 raise util.Abort(_('path %r is inside nested repo %r')
102 % (path, base))
102 % (path, base))
103
103
104 normparts = util.splitpath(normpath)
105 assert len(parts) == len(normparts)
106
104 parts.pop()
107 parts.pop()
108 normparts.pop()
105 prefixes = []
109 prefixes = []
106 while parts:
110 while parts:
107 prefix = os.sep.join(parts)
111 prefix = os.sep.join(parts)
108 if prefix in self.auditeddir:
112 normprefix = os.sep.join(normparts)
113 if normprefix in self.auditeddir:
109 break
114 break
110 curpath = os.path.join(self.root, prefix)
115 curpath = os.path.join(self.root, prefix)
111 try:
116 try:
@@ -125,8 +130,9 b' class pathauditor(object):'
125 if not self.callback or not self.callback(curpath):
130 if not self.callback or not self.callback(curpath):
126 raise util.Abort(_('path %r is inside nested repo %r') %
131 raise util.Abort(_('path %r is inside nested repo %r') %
127 (path, prefix))
132 (path, prefix))
128 prefixes.append(prefix)
133 prefixes.append(normprefix)
129 parts.pop()
134 parts.pop()
135 normparts.pop()
130
136
131 self.audited.add(normpath)
137 self.audited.add(normpath)
132 # only add prefixes to the cache after checking everything: we don't
138 # only add prefixes to the cache after checking everything: we don't
General Comments 0
You need to be logged in to leave comments. Login now