[PATCH 2 of 3] streamclone: comment why path auditing is disabled in generatev1()

Yuya Nishihara yuya at tcha.org
Fri Jul 7 11:14:02 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1499437171 -32400
#      Fri Jul 07 23:19:31 2017 +0900
# Node ID 4249fe0f2a768bd556bd8e69e1b62baa20594190
# Parent  975c99e7fc675b5f1f89b348cc91651e0d48eb61
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.

diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -221,6 +221,8 @@ def generatev1(repo):
                 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)


More information about the Mercurial-devel mailing list