# HG changeset patch # User Gregory Szorc # Date 1523643579 25200 # Node ID add1298111766957f34939bbd398b0f08e193ff0 # Parent ce8828217369fcce8e71eba9e2244c604998a339 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 diff -r ce8828217369 -r add129811176 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))