##// END OF EJS Templates
bundlerepo: use command executor for wire protocol commands...
Gregory Szorc -
r37661:1aa4d646 default
parent child Browse files
Show More
@@ -540,17 +540,26 b' def getremotechanges(ui, repo, peer, onl'
540 and peer.capable('getbundle')
540 and peer.capable('getbundle')
541 and peer.capable('bundle2'))
541 and peer.capable('bundle2'))
542 if canbundle2:
542 if canbundle2:
543 kwargs = {}
543 with peer.commandexecutor() as e:
544 kwargs[r'common'] = common
544 b2 = e.callcommand('getbundle', {
545 kwargs[r'heads'] = rheads
545 'source': 'incoming',
546 kwargs[r'bundlecaps'] = exchange.caps20to10(repo, role='client')
546 'common': common,
547 kwargs[r'cg'] = True
547 'heads': rheads,
548 b2 = peer.getbundle('incoming', **kwargs)
548 'bundlecaps': exchange.caps20to10(repo, role='client'),
549 fname = bundle = changegroup.writechunks(ui, b2._forwardchunks(),
549 'cg': True,
550 bundlename)
550 }).result()
551
552 fname = bundle = changegroup.writechunks(ui,
553 b2._forwardchunks(),
554 bundlename)
551 else:
555 else:
552 if peer.capable('getbundle'):
556 if peer.capable('getbundle'):
553 cg = peer.getbundle('incoming', common=common, heads=rheads)
557 with peer.commandexecutor() as e:
558 cg = e.callcommand('getbundle', {
559 'source': 'incoming',
560 'common': common,
561 'heads': rheads,
562 }).result()
554 elif onlyheads is None and not peer.capable('changegroupsubset'):
563 elif onlyheads is None and not peer.capable('changegroupsubset'):
555 # compat with older servers when pulling all remote heads
564 # compat with older servers when pulling all remote heads
556
565
@@ -594,7 +603,11 b' def getremotechanges(ui, repo, peer, onl'
594
603
595 if bundlerepo:
604 if bundlerepo:
596 reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]]
605 reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]]
597 remotephases = peer.listkeys('phases')
606
607 with peer.commandexecutor() as e:
608 remotephases = e.callcommand('listkeys', {
609 'namespace': 'phases',
610 }).result()
598
611
599 pullop = exchange.pulloperation(bundlerepo, peer, heads=reponodes)
612 pullop = exchange.pulloperation(bundlerepo, peer, heads=reponodes)
600 pullop.trmanager = bundletransactionmanager()
613 pullop.trmanager = bundletransactionmanager()
General Comments 0
You need to be logged in to leave comments. Login now