D3292: bookmarks: use command executor for wire protocol commands

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Apr 12 20:00:27 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  And change the name of a variable to reflect that is is a peer.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bookmarks.py

CHANGE DETAILS

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -646,12 +646,18 @@
             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:
+        fbookmarks = e.callcommand('listkeys', {
+            'namespace': 'bookmarks',
+        })
+
+    remotemarks = unhexlifybookmarks(fbookmarks.result())
+
     r = comparebookmarks(repo, remotemarks, repo._bookmarks)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
 
@@ -733,12 +739,18 @@
 
     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:
+        fbookmarks = e.callcommand('listkeys', {
+            'namespace': 'bookmarks',
+        })
+
+    remotemarks = unhexlifybookmarks(fbookmarks.result())
+
     r = comparebookmarks(repo, remotemarks, repo._bookmarks)
     addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
     return (len(addsrc), len(adddst))



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


More information about the Mercurial-devel mailing list