# HG changeset patch # User Gregory Szorc # Date 2018-04-13 18:21:55 # Node ID 1aa4d646d0de30a453b5e9fe2aabd5937d49c1ad # Parent d959277ff1b55955303a389b8acb5d45fe474502 bundlerepo: use command executor for wire protocol commands Differential Revision: https://phab.mercurial-scm.org/D3294 diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -540,17 +540,26 @@ def getremotechanges(ui, repo, peer, onl and peer.capable('getbundle') and peer.capable('bundle2')) if canbundle2: - kwargs = {} - kwargs[r'common'] = common - kwargs[r'heads'] = rheads - kwargs[r'bundlecaps'] = exchange.caps20to10(repo, role='client') - kwargs[r'cg'] = True - b2 = peer.getbundle('incoming', **kwargs) - fname = bundle = changegroup.writechunks(ui, b2._forwardchunks(), - bundlename) + with peer.commandexecutor() as e: + b2 = e.callcommand('getbundle', { + 'source': 'incoming', + 'common': common, + 'heads': rheads, + 'bundlecaps': exchange.caps20to10(repo, role='client'), + 'cg': True, + }).result() + + fname = bundle = changegroup.writechunks(ui, + b2._forwardchunks(), + bundlename) else: if peer.capable('getbundle'): - cg = peer.getbundle('incoming', common=common, heads=rheads) + with peer.commandexecutor() as e: + cg = e.callcommand('getbundle', { + 'source': 'incoming', + 'common': common, + 'heads': rheads, + }).result() elif onlyheads is None and not peer.capable('changegroupsubset'): # compat with older servers when pulling all remote heads @@ -594,7 +603,11 @@ def getremotechanges(ui, repo, peer, onl if bundlerepo: reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]] - remotephases = peer.listkeys('phases') + + with peer.commandexecutor() as e: + remotephases = e.callcommand('listkeys', { + 'namespace': 'phases', + }).result() pullop = exchange.pulloperation(bundlerepo, peer, heads=reponodes) pullop.trmanager = bundletransactionmanager()