Patchwork D3289: streamclone: use command executor for wire protocol commands

login
register
mail settings
Submitter phabricator
Date April 13, 2018, 10:09 p.m.
Message ID <c756e6b21493f3d930628ae641951210@localhost.localdomain>
Download mbox | patch
Permalink /patch/30920/
State Not Applicable
Headers show

Comments

phabricator - April 13, 2018, 10:09 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG65b86ee69383: streamclone: use command executor for wire protocol commands (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3289?vs=8128&id=8174

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

AFFECTED FILES
  mercurial/streamclone.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -126,11 +126,18 @@ 
     # creation.
     rbranchmap = None
     if remote.capable('branchmap'):
-        rbranchmap = remote.branchmap()
+        with remote.commandexecutor() as e:
+            rbranchmap = e.callcommand('branchmap', {}).result()
 
     repo.ui.status(_('streaming all changes\n'))
 
-    fp = remote.stream_out()
+    with remote.commandexecutor() as e:
+        fp = e.callcommand('stream_out', {}).result()
+
+    # TODO strictly speaking, this code should all be inside the context
+    # manager because the context manager is supposed to ensure all wire state
+    # is flushed when exiting. But the legacy peers don't do this, so it
+    # doesn't matter.
     l = fp.readline()
     try:
         resp = int(l)