[PATCH 4 of 4 modernize-streamclone] exchange: add "streaming all changes" to bundle2 pulling
Gregory Szorc
gregory.szorc at gmail.com
Sun Oct 4 21:32:40 CDT 2015
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# 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/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -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
pullop.stepsdone.add('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.
kwargs['listkeys'].append('bookmarks')
- 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
else:
if pullop.heads is None and list(pullop.common) == [nullid]:
More information about the Mercurial-devel
mailing list