diff mercurial/exchange.py @ 35763:7eedbd5d4880

streamclone: add support for bundle2 based stream clone The feature put to use the various bits introduced previously. If the server supports it, the client will request its stream clone through bundle2 instead of the legacy 'stream_out' commands. The bundle2 version use the better 'v2' version of stream bundles. The 'v2' format is not finalized yet. Now that there are some code running it, we can start working on it again. Performance numbers are available at the end of this series.
author Boris Feld <boris.feld@octobus.net>
date Wed, 17 Jan 2018 16:41:44 +0100
parents 40df727b6f4f
children 56c30b31afbe
line wrap: on
line diff
--- a/mercurial/exchange.py	Wed Jan 17 14:13:46 2018 +0100
+++ b/mercurial/exchange.py	Wed Jan 17 16:41:44 2018 +0100
@@ -1455,13 +1455,18 @@
 
     # At the moment we don't do stream clones over bundle2. If that is
     # implemented then here's where the check for that will go.
-    streaming = False
+    streaming = streamclone.canperformstreamclone(pullop, bundle2=True)[0]
 
     # declare pull perimeters
     kwargs['common'] = pullop.common
     kwargs['heads'] = pullop.heads or pullop.rheads
 
-    if True:
+    if streaming:
+        kwargs['cg'] = False
+        kwargs['stream'] = True
+        pullop.stepsdone.add('changegroup')
+
+    else:
         # pulling changegroup
         pullop.stepsdone.add('changegroup')