##// END OF EJS Templates
exchange: use command executor interface for calling listkeys...
Gregory Szorc -
r37775:2a8ad00b default
parent child Browse files
Show More
@@ -591,7 +591,8 b' def _pushdiscoveryphase(pushop):'
591 591 (computed for both success and failure case for changesets push)"""
592 592 outgoing = pushop.outgoing
593 593 unfi = pushop.repo.unfiltered()
594 remotephases = pushop.remote.listkeys('phases')
594 remotephases = listkeys(pushop.remote, 'phases')
595
595 596 if (pushop.ui.configbool('ui', '_usedassubrepo')
596 597 and remotephases # server supports phases
597 598 and not pushop.outgoing.missing # no changesets to be pushed
@@ -638,9 +639,15 b' def _pushdiscoveryphase(pushop):'
638 639
639 640 @pushdiscovery('obsmarker')
640 641 def _pushdiscoveryobsmarkers(pushop):
641 if (obsolete.isenabled(pushop.repo, obsolete.exchangeopt)
642 and pushop.repo.obsstore
643 and 'obsolete' in pushop.remote.listkeys('namespaces')):
642 if not obsolete.isenabled(pushop.repo, obsolete.exchangeopt):
643 return
644
645 if not pushop.repo.obsstore:
646 return
647
648 if 'obsolete' not in listkeys(pushop.remote, 'namespaces'):
649 return
650
644 651 repo = pushop.repo
645 652 # very naive computation, that can be quite expensive on big repo.
646 653 # However: evolution is currently slow on them anyway.
@@ -657,7 +664,8 b' def _pushdiscoverybookmarks(pushop):'
657 664 if pushop.revs:
658 665 revnums = map(repo.changelog.rev, pushop.revs)
659 666 ancestors = repo.changelog.ancestors(revnums, inclusive=True)
660 remotebookmark = remote.listkeys('bookmarks')
667
668 remotebookmark = listkeys(remote, 'bookmarks')
661 669
662 670 explicit = set([repo._bookmarks.expandname(bookmark)
663 671 for bookmark in pushop.bookmarks])
@@ -1168,7 +1176,7 b' def _pushsyncphase(pushop):'
1168 1176 """synchronise phase information locally and remotely"""
1169 1177 cheads = pushop.commonheads
1170 1178 # even when we don't push, exchanging phase data is useful
1171 remotephases = pushop.remote.listkeys('phases')
1179 remotephases = listkeys(pushop.remote, 'phases')
1172 1180 if (pushop.ui.configbool('ui', '_usedassubrepo')
1173 1181 and remotephases # server supports phases
1174 1182 and pushop.cgresult is None # nothing was pushed
@@ -1392,6 +1400,10 b' class transactionmanager(util.transactio'
1392 1400 if self._tr is not None:
1393 1401 self._tr.release()
1394 1402
1403 def listkeys(remote, namespace):
1404 with remote.commandexecutor() as e:
1405 return e.callcommand('listkeys', {'namespace': namespace}).result()
1406
1395 1407 def _fullpullbundle2(repo, pullop):
1396 1408 # The server may send a partial reply, i.e. when inlining
1397 1409 # pre-computed bundles. In that case, update the common
@@ -1529,7 +1541,7 b' def _pullbookmarkbundle1(pullop):'
1529 1541 # all known bundle2 servers now support listkeys, but lets be nice with
1530 1542 # new implementation.
1531 1543 return
1532 books = pullop.remote.listkeys('bookmarks')
1544 books = listkeys(pullop.remote, 'bookmarks')
1533 1545 pullop.remotebookmarks = bookmod.unhexlifybookmarks(books)
1534 1546
1535 1547
@@ -1741,7 +1753,7 b' def _pullphase(pullop):'
1741 1753 # Get remote phases data from remote
1742 1754 if 'phases' in pullop.stepsdone:
1743 1755 return
1744 remotephases = pullop.remote.listkeys('phases')
1756 remotephases = listkeys(pullop.remote, 'phases')
1745 1757 _pullapplyphases(pullop, remotephases)
1746 1758
1747 1759 def _pullapplyphases(pullop, remotephases):
@@ -1805,7 +1817,7 b' def _pullobsolete(pullop):'
1805 1817 tr = None
1806 1818 if obsolete.isenabled(pullop.repo, obsolete.exchangeopt):
1807 1819 pullop.repo.ui.debug('fetching remote obsolete markers\n')
1808 remoteobs = pullop.remote.listkeys('obsolete')
1820 remoteobs = listkeys(pullop.remote, 'obsolete')
1809 1821 if 'dump0' in remoteobs:
1810 1822 tr = pullop.gettransaction()
1811 1823 markers = []
General Comments 0
You need to be logged in to leave comments. Login now