##// 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 # partially encode name over the wire for backwards compat
225 # partially encode name over the wire for backwards compat
226 yield '%s\0%d\n' % (store.encodedir(name), size)
226 yield '%s\0%d\n' % (store.encodedir(name), size)
227 if size <= 65536:
227 if size <= 65536:
228 with svfs(name, 'rb') as fp:
228 with svfs(name, 'rb', auditpath=False) as fp:
229 yield fp.read(size)
229 yield fp.read(size)
230 else:
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 yield chunk
233 yield chunk
233 finally:
234 finally:
234 svfs.mustaudit = oldaudit
235 svfs.mustaudit = oldaudit
@@ -320,7 +320,8 b' class vfs(abstractvfs):'
320 os.chmod(name, self.createmode & 0o666)
320 os.chmod(name, self.createmode & 0o666)
321
321
322 def __call__(self, path, mode="r", text=False, atomictemp=False,
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 '''Open ``path`` file, which is relative to vfs root.
325 '''Open ``path`` file, which is relative to vfs root.
325
326
326 Newly created directories are marked as "not to be indexed by
327 Newly created directories are marked as "not to be indexed by
@@ -344,6 +345,7 b' class vfs(abstractvfs):'
344 only for writing), and is useful only if target file is
345 only for writing), and is useful only if target file is
345 guarded by any lock (e.g. repo.lock or repo.wlock).
346 guarded by any lock (e.g. repo.lock or repo.wlock).
346 '''
347 '''
348 if auditpath:
347 if self._audit:
349 if self._audit:
348 r = util.checkosfilename(path)
350 r = util.checkosfilename(path)
349 if r:
351 if r:
General Comments 0
You need to be logged in to leave comments. Login now