Mercurial > hg-stable
comparison mercurial/streamclone.py @ 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 | 0407a51b9d8c |
comparison
equal
deleted
inserted
replaced
33410:c784308305c6 | 33411:50b49bb0fff3 |
---|---|
219 for name, size in entries: | 219 for name, size in entries: |
220 if debugflag: | 220 if debugflag: |
221 repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) | 221 repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) |
222 # partially encode name over the wire for backwards compat | 222 # partially encode name over the wire for backwards compat |
223 yield '%s\0%d\n' % (store.encodedir(name), size) | 223 yield '%s\0%d\n' % (store.encodedir(name), size) |
224 # auditing at this stage is both pointless (paths are already | |
225 # trusted by the local repo) and expensive | |
224 with svfs(name, 'rb', auditpath=False) as fp: | 226 with svfs(name, 'rb', auditpath=False) as fp: |
225 if size <= 65536: | 227 if size <= 65536: |
226 yield fp.read(size) | 228 yield fp.read(size) |
227 else: | 229 else: |
228 for chunk in util.filechunkiter(fp, limit=size): | 230 for chunk in util.filechunkiter(fp, limit=size): |