Mercurial > public > mercurial-scm > hg-stable
diff tests/test-bundle2-multiple-changegroups.t @ 29818:d4e026341e16
getchangegroup: take an 'outgoing' object as argument (API)
There is various version of this function that differ mostly by the way they
define the bundled set. The flexibility is now available in the outgoing object
itself so we move the complexity into the caller themself. This will allow use
to remove a good share of the similar function to obtains a changegroup in the
'changegroup.py' module.
An important side effect is that we stop calling 'computeoutgoing' in
'getchangegroup'. This is fine as code that needs such argument processing
is actually going through the 'exchange' module which already all this function
itself.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 09 Aug 2016 17:00:38 +0200 |
parents | 622782ea9cf3 |
children | 728d37353e1e |
line wrap: on
line diff
--- a/tests/test-bundle2-multiple-changegroups.t Tue Aug 09 22:31:38 2016 +0200 +++ b/tests/test-bundle2-multiple-changegroups.t Tue Aug 09 17:00:38 2016 +0200 @@ -3,7 +3,7 @@ $ cat > bundle2.py <<EOF > """ > """ - > from mercurial import changegroup, exchange + > from mercurial import changegroup, discovery, exchange > > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, > b2caps=None, heads=None, common=None, @@ -12,13 +12,14 @@ > # changegroup part we are being requested. Use the parent of each head > # in 'heads' as intermediate heads for the first changegroup. > intermediates = [repo[r].p1().node() for r in heads] - > cg = changegroup.getchangegroup(repo, source, heads=intermediates, - > common=common, bundlecaps=bundlecaps) + > outgoing = discovery.outgoing(repo, common, intermediates) + > cg = changegroup.getchangegroup(repo, source, outgoing, + > bundlecaps=bundlecaps) > bundler.newpart('output', data='changegroup1') > bundler.newpart('changegroup', data=cg.getchunks()) - > cg = changegroup.getchangegroup(repo, source, heads=heads, - > common=common + intermediates, - > bundlecaps=bundlecaps) + > outgoing = discovery.outgoing(repo, common + intermediates, heads) + > cg = changegroup.getchangegroup(repo, source, outgoing, + > bundlecaps=bundlecaps) > bundler.newpart('output', data='changegroup2') > bundler.newpart('changegroup', data=cg.getchunks()) >