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
--- 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))