Patchwork [4,of,4,modernize-streamclone] exchange: add "streaming all changes" to bundle2 pulling

mail settings
Submitter Gregory Szorc
Date Oct. 5, 2015, 2:32 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/10803/
State Accepted
Headers show


Gregory Szorc - Oct. 5, 2015, 2:32 a.m.
# HG changeset patch
# User Gregory Szorc <>
# Date 1443985904 25200
#      Sun Oct 04 12:11:44 2015 -0700
# Node ID 52d5ad50be88cca773942a53a8acfbe86c52c464
# Parent  7c7141ed5c21ddb9332ccc626ad5ac1c17f7eebb
exchange: add "streaming all changes" to bundle2 pulling

This is the beginning of client-side support for performing a stream
clone using bundle2. The main bundle2 pull function checks whether to
perform a streaming clone and outputs a message if so.

While we have a duplicate message, it seems easier to have all the
bundle2 console writing in one location and in an easy-to-read
conditional block.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -1065,8 +1065,11 @@  def _pullbundle2(pullop):
     """pull data using bundle2
     For now, the only supported data are changegroup."""
     kwargs = {'bundlecaps': caps20to10(pullop.repo)}
+    streaming, streamreqs = streamclone.canperformstreamclone(pullop)
     # pulling changegroup
     kwargs['common'] = pullop.common
@@ -1077,9 +1080,11 @@  def _pullbundle2(pullop):
         if pullop.remotebookmarks is None:
             # make sure to always includes bookmark data when migrating
             # `hg incoming --bundle` to using this function.
-    if not pullop.fetch:
+    if streaming:
+        pullop.repo.ui.status(_('streaming all changes\n'))
+    elif not pullop.fetch:
         pullop.repo.ui.status(_("no changes found\n"))
         pullop.cgresult = 0
         if pullop.heads is None and list(pullop.common) == [nullid]: