Mercurial > public > mercurial-scm > hg
diff mercurial/bundle2.py @ 37005:66c0ff381cfc
bundle: condition the changegroup part when creating a new bundle
We will generate stream bundle in the next changesets which doesn't need the
changegroup part.
Differential Revision: https://phab.mercurial-scm.org/D1951
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 31 Jan 2018 09:41:47 +0100 |
parents | 2090044a288d |
children | f0b6fbea00cf |
line wrap: on
line diff
--- a/mercurial/bundle2.py Fri Jan 19 17:29:50 2018 +0100 +++ b/mercurial/bundle2.py Wed Jan 31 09:41:47 2018 +0100 @@ -1577,19 +1577,21 @@ # different right now. So we keep them separated for now for the sake of # simplicity. - # we always want a changegroup in such bundle - cgversion = opts.get('cg.version') - if cgversion is None: - cgversion = changegroup.safeversion(repo) - cg = changegroup.makechangegroup(repo, outgoing, cgversion, source) - part = bundler.newpart('changegroup', data=cg.getchunks()) - part.addparam('version', cg.version) - if 'clcount' in cg.extras: - part.addparam('nbchanges', '%d' % cg.extras['clcount'], - mandatory=False) - if opts.get('phases') and repo.revs('%ln and secret()', - outgoing.missingheads): - part.addparam('targetphase', '%d' % phases.secret, mandatory=False) + # we might not always want a changegroup in such bundle, for example in + # stream bundles + if opts.get('changegroup', True): + cgversion = opts.get('cg.version') + if cgversion is None: + cgversion = changegroup.safeversion(repo) + cg = changegroup.makechangegroup(repo, outgoing, cgversion, source) + part = bundler.newpart('changegroup', data=cg.getchunks()) + part.addparam('version', cg.version) + if 'clcount' in cg.extras: + part.addparam('nbchanges', '%d' % cg.extras['clcount'], + mandatory=False) + if opts.get('phases') and repo.revs('%ln and secret()', + outgoing.missingheads): + part.addparam('targetphase', '%d' % phases.secret, mandatory=False) addparttagsfnodescache(repo, bundler, outgoing) addpartrevbranchcache(repo, bundler, outgoing)