##// END OF EJS Templates
vfs: simplify path audit disabling in stream clone...
marmoute -
r33255:15e9cbe6 default
parent child Browse files
Show More
@@ -225,10 +225,11 b' def generatev1(repo):'
225 225 # partially encode name over the wire for backwards compat
226 226 yield '%s\0%d\n' % (store.encodedir(name), size)
227 227 if size <= 65536:
228 with svfs(name, 'rb') as fp:
228 with svfs(name, 'rb', auditpath=False) as fp:
229 229 yield fp.read(size)
230 230 else:
231 for chunk in util.filechunkiter(svfs(name), limit=size):
231 data = svfs(name, auditpath=False)
232 for chunk in util.filechunkiter(data, limit=size):
232 233 yield chunk
233 234 finally:
234 235 svfs.mustaudit = oldaudit
@@ -320,7 +320,8 b' class vfs(abstractvfs):'
320 320 os.chmod(name, self.createmode & 0o666)
321 321
322 322 def __call__(self, path, mode="r", text=False, atomictemp=False,
323 notindexed=False, backgroundclose=False, checkambig=False):
323 notindexed=False, backgroundclose=False, checkambig=False,
324 auditpath=True):
324 325 '''Open ``path`` file, which is relative to vfs root.
325 326
326 327 Newly created directories are marked as "not to be indexed by
@@ -344,11 +345,12 b' class vfs(abstractvfs):'
344 345 only for writing), and is useful only if target file is
345 346 guarded by any lock (e.g. repo.lock or repo.wlock).
346 347 '''
347 if self._audit:
348 r = util.checkosfilename(path)
349 if r:
350 raise error.Abort("%s: %r" % (r, path))
351 self.audit(path)
348 if auditpath:
349 if self._audit:
350 r = util.checkosfilename(path)
351 if r:
352 raise error.Abort("%s: %r" % (r, path))
353 self.audit(path)
352 354 f = self.join(path)
353 355
354 356 if not text and "b" not in mode:
General Comments 0
You need to be logged in to leave comments. Login now