D3292: bookmarks: use command executor for wire protocol commands

2018-04-13 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  In https://phab.mercurial-scm.org/D3292#53207, @durin42 wrote:
  
  > btw, I don't love how this looks, it feels like we could probably revisit 
letting "normal" function calls work for one-shot requests like this, but let's 
do it later once we map the new wireproto world a little more
  
  
  I’m not opposed to providing a helper method that wraps and makes the 
consumer simpler. Where my mind is at is that proto v2 commands will be smaller 
and we’ll issue more of them. I wanted to make batching and transfer semantics 
for half-duplex connections explicit.

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3292: bookmarks: use command executor for wire protocol commands

2018-04-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGadd129811176: bookmarks: use command executor for wire 
protocol commands (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3292?vs=8131=8177

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



To: indygreg, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3292: bookmarks: use command executor for wire protocol commands

2018-04-13 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 8131.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3292?vs=8085=8131

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



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3292: bookmarks: use command executor for wire protocol commands

2018-04-12 Thread indygreg (Gregory Szorc)
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
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel