Patchwork D3290: logexchange: use command executor for wire protocol commands

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 7:59 p.m.
Message ID <differential-rev-PHID-DREV-3vx54f4e6djnw2kyksxp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30824/
State Superseded
Headers show

Comments

phabricator - April 12, 2018, 7:59 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3290

AFFECTED FILES
  mercurial/logexchange.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/logexchange.py b/mercurial/logexchange.py
--- a/mercurial/logexchange.py
+++ b/mercurial/logexchange.py
@@ -127,14 +127,25 @@ 
     remoterepo is the peer instance
     """
     remotepath = activepath(localrepo, remoterepo)
-    bookmarks = remoterepo.listkeys('bookmarks')
+
+    with remoterepo.commandexecutor() as e:
+        fbookmarks = e.callcommand('listkeys', {
+            'namespace': 'bookmarks',
+        })
+
+    bookmarks = fbookmarks.result()
+
     # on a push, we don't want to keep obsolete heads since
     # they won't show up as heads on the next pull, so we
     # remove them here otherwise we would require the user
     # to issue a pull to refresh the storage
     bmap = {}
     repo = localrepo.unfiltered()
-    for branch, nodes in remoterepo.branchmap().iteritems():
+
+    with remoterepo.commandexecutor() as e:
+        fbranchmap = e.callcommand('branchmap', {})
+
+    for branch, nodes in fbranchmap.result().iteritems():
         bmap[branch] = []
         for node in nodes:
             if node in repo and not repo[node].obsolete():