diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1601,6 +1601,16 @@ phasedata = phases.binaryencode(headsbyphase) bundler.newpart('phase-heads', data=phasedata) + if opts.get('streamv2', False): + # The generation of the stream part is currently in exchange but + # importing exchange create an import cycle. We could extract the + # generation of the stream part in bundle2 or another file. + from . import exchange + # The streamv2 part doesn't uses the source argument, we can refactor + # this once the bundle part generator has been extracted + source = None + exchange._getbundlestream2(bundler, repo, source, stream=True) + def addparttagsfnodescache(repo, bundler, outgoing): # we include the tags fnode cache for the bundle changeset # (as an optional parts)