mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
util: move checkosfilename call from path_auditor to opener
path_auditor is used for checking patterns too, but a pattern is not a valid filename. This patch fixes fb1792e89e34, which introduced the bug: $ hg log -l3 glob:**.py abort: filename contains '*', which is reserved on Windows: mercurial\**.py
This commit is contained in:
parent
3828767e58
commit
a5b6c426a2
@ -602,9 +602,6 @@ class path_auditor(object):
|
||||
prefixes.append(prefix)
|
||||
parts.pop()
|
||||
|
||||
r = checkosfilename(path)
|
||||
if r:
|
||||
raise Abort("%s: %s" % (r, path))
|
||||
self.audited.add(path)
|
||||
# only add prefixes to the cache after checking everything: we don't
|
||||
# want to add "foo/bar/baz" before checking if there's a "foo/.hg"
|
||||
@ -916,6 +913,9 @@ class opener(object):
|
||||
os.chmod(name, self.createmode & 0666)
|
||||
|
||||
def __call__(self, path, mode="r", text=False, atomictemp=False):
|
||||
r = checkosfilename(path)
|
||||
if r:
|
||||
raise Abort("%s: %s" % (r, path))
|
||||
self.auditor(path)
|
||||
f = os.path.join(self.base, path)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user