Mercurial > hg
changeset 37641:add129811176
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
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 13 Apr 2018 11:19:39 -0700 |
parents | ce8828217369 |
children | d959277ff1b5 |
files | mercurial/bookmarks.py |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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))