# HG changeset patch # User Gregory Szorc # Date 2015-10-04 19:11:44 # Node ID 41dd7b2c7e15edf96e4c5ae99f72e75ba36838e4 # Parent 4b5647d9ee131ae3d779527e183aebeae34edb90 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 @@ -1075,6 +1075,9 @@ def _pullbundle2(pullop): For now, the only supported data are changegroup.""" kwargs = {'bundlecaps': caps20to10(pullop.repo)} + + streaming, streamreqs = streamclone.canperformstreamclone(pullop) + # pulling changegroup pullop.stepsdone.add('changegroup') @@ -1087,7 +1090,9 @@ def _pullbundle2(pullop): # 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: