changeset 33411:50b49bb0fff3

streamclone: comment why path auditing is disabled in generatev1() Copied from 39c6e349dfff. I wasn't sure whether it's for optimization or suppressing unwanted error.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 07 Jul 2017 23:19:31 +0900
parents c784308305c6
children a42369e04aee
files mercurial/streamclone.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/streamclone.py	Fri Jul 07 23:25:16 2017 +0900
+++ b/mercurial/streamclone.py	Fri Jul 07 23:19:31 2017 +0900
@@ -221,6 +221,8 @@
                 repo.ui.debug('sending %s (%d bytes)\n' % (name, size))
             # partially encode name over the wire for backwards compat
             yield '%s\0%d\n' % (store.encodedir(name), size)
+            # auditing at this stage is both pointless (paths are already
+            # trusted by the local repo) and expensive
             with svfs(name, 'rb', auditpath=False) as fp:
                 if size <= 65536:
                     yield fp.read(size)