bookmarks: use command executor for wire protocol commands
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 13 Apr 2018 11:19:39 -0700
changeset 37641 add129811176
parent 37640 ce8828217369
child 37642 d959277ff1b5
bookmarks: use command executor for wire protocol commands And change the name of a variable to reflect that is is a peer. Differential Revision: https://phab.mercurial-scm.org/D3292
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Fri Apr 13 11:17:45 2018 -0700
+++ b/mercurial/bookmarks.py	Fri Apr 13 11:19:39 2018 -0700
@@ -646,12 +646,16 @@
             writer(msg)
         localmarks.applychanges(repo, tr, changes)
 
-def incoming(ui, repo, other):
+def incoming(ui, repo, peer):
     '''Show bookmarks incoming from other to repo
     '''
     ui.status(_("searching for changed bookmarks\n"))
 
-    remotemarks = unhexlifybookmarks(other.listkeys('bookmarks'))
+    with peer.commandexecutor() as e:
+        remotemarks = unhexlifybookmarks(e.callcommand('listkeys', {
+            'namespace': 'bookmarks',
+        }).result())
+
     r = comparebookmarks(repo, remotemarks, repo._bookmarks)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
 
@@ -733,12 +737,16 @@
 
     return 0
 
-def summary(repo, other):
+def summary(repo, peer):
     '''Compare bookmarks between repo and other for "hg summary" output
 
     This returns "(# of incoming, # of outgoing)" tuple.
     '''
-    remotemarks = unhexlifybookmarks(other.listkeys('bookmarks'))
+    with peer.commandexecutor() as e:
+        remotemarks = unhexlifybookmarks(e.callcommand('listkeys', {
+            'namespace': 'bookmarks',
+        }).result())
+
     r = comparebookmarks(repo, remotemarks, repo._bookmarks)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
     return (len(addsrc), len(adddst))