diff -r e1b32dc4646c -r 2f626233859b mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py Fri Apr 13 10:51:23 2018 -0700 +++ b/mercurial/setdiscovery.py Fri Apr 13 11:02:34 2018 -0700 @@ -155,11 +155,14 @@ sample = _limitsample(ownheads, initialsamplesize) # indices between sample and externalized version must match sample = list(sample) - batch = remote.iterbatch() - batch.heads() - batch.known(dag.externalizeall(sample)) - batch.submit() - srvheadhashes, yesno = batch.results() + + with remote.commandexecutor() as e: + fheads = e.callcommand('heads', {}) + fknown = e.callcommand('known', { + 'nodes': dag.externalizeall(sample), + }) + + srvheadhashes, yesno = fheads.result(), fknown.result() if cl.tip() == nullid: if srvheadhashes != [nullid]: