From patchwork Tue Mar 8 04:25:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 7, iterbatch] setdiscovery: use iterbatch interface instead of batch From: Augie Fackler X-Patchwork-Id: 13660 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 07 Mar 2016 23:25:40 -0500 # HG changeset patch # User Augie Fackler # Date 1456872281 18000 # Tue Mar 01 17:44:41 2016 -0500 # Node ID daf0fd2b309cfa46fa5911ed988ad2dad945e9b0 # Parent 409accaf401bbad8a3a3d1523bb455a02f6a4560 # EXP-Topic batch setdiscovery: use iterbatch interface instead of batch It's a little more concise, and gives us some simple test coverage. diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -147,12 +147,11 @@ def findcommonheads(ui, local, remote, sample = _limitsample(ownheads, initialsamplesize) # indices between sample and externalized version must match sample = list(sample) - batch = remote.batch() - srvheadhashesref = batch.heads() - yesnoref = batch.known(dag.externalizeall(sample)) + batch = remote.iterbatch() + batch.heads() + batch.known(dag.externalizeall(sample)) batch.submit() - srvheadhashes = srvheadhashesref.value - yesno = yesnoref.value + srvheadhashes, yesno = batch.results() if cl.tip() == nullid: if srvheadhashes != [nullid]: