martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers.
REVISION SUMMARY peer.commandexecutor()'s context manager waits for all responses to arrive in its __exit__() method. When batching requests, one often wants to process the requests as they arrive. That means one has to call future.result() before exiting the command executor's context manager. It doesn't matter in practice here (where we batch only "heads" and "known" and don't care to process either until both responses have arrived), but let's make this code a good example for others who may want to copy the pattern. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4667 AFFECTED FILES mercurial/setdiscovery.py CHANGE DETAILS diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -189,8 +189,7 @@ fknown = e.callcommand('known', { 'nodes': [clnode(r) for r in sample], }) - - srvheadhashes, yesno = fheads.result(), fknown.result() + srvheadhashes, yesno = fheads.result(), fknown.result() if cl.tip() == nullid: if srvheadhashes != [nullid]: To: martinvonz, #hg-reviewers Cc: mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel