Mercurial > hg
changeset 40173:b797150a1ab9
exchangev2: honor server advertised manifestdata recommended batch size
Let's plug the client up to the server-advertised recommended batch size
for manifestdata requests.
Differential Revision: https://phab.mercurial-scm.org/D4976
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 03 Oct 2018 13:17:00 -0700 |
parents | 30f70d11c224 |
children | 64360202d5b2 |
files | mercurial/exchangev2.py |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/exchangev2.py Mon Oct 08 17:45:51 2018 -0700 +++ b/mercurial/exchangev2.py Wed Oct 03 13:17:00 2018 -0700 @@ -268,10 +268,9 @@ progress = repo.ui.makeprogress(_('manifests'), unit=_('chunks'), total=len(fetchnodes)) - # Fetch manifests 10,000 per command. - # TODO have server advertise preferences? + commandmeta = remote.apidescriptor[b'commands'][b'manifestdata'] + batchsize = commandmeta.get(b'recommendedbatchsize', 10000) # TODO make size configurable on client? - batchsize = 10000 # We send commands 1 at a time to the remote. This is not the most # efficient because we incur a round trip at the end of each batch.