Patchwork D3288: discovery: use command executor interface

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 7:59 p.m.
Message ID <differential-rev-PHID-DREV-g5wds6jnzcghrnlf6jga-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30822/
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.

REVISION SUMMARY
  We're trying to port all wire protocol code to use the new
  interface so we can implement wire protocol version 2 clients.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/discovery.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -203,7 +203,11 @@ 
     headssum = {}
     # A. Create set of branches involved in the push.
     branches = set(repo[n].branch() for n in outgoing.missing)
-    remotemap = remote.branchmap()
+
+    with remote.commandexecutor() as e:
+        fremotemap = e.callcommand('branchmap', {})
+
+    remotemap = fremotemap.result()
     newbranches = branches - set(remotemap)
     branches.difference_update(newbranches)
 
@@ -287,7 +291,13 @@ 
     repo = pushop.repo.unfiltered()
     remote = pushop.remote
     localbookmarks = repo._bookmarks
-    remotebookmarks = remote.listkeys('bookmarks')
+
+    with remote.commandexecutor() as e:
+        fremotebookmarks = e.callcommand('listkeys', {
+            'namespace': 'bookmarks',
+        })
+
+    remotebookmarks = fremotebookmarks.result()
     bookmarkedheads = set()
 
     # internal config: bookmarks.pushing