Mercurial > public > mercurial-scm > hg
comparison mercurial/exchange.py @ 29807: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 | 531e85eec23c |
children | 8d226db31f20 |
comparison
equal
deleted
inserted
replaced
29806:82e8c86cdd6d | 29807:d4e026341e16 |
---|---|
1534 raise ValueError(_('request for bundle10 must include changegroup')) | 1534 raise ValueError(_('request for bundle10 must include changegroup')) |
1535 | 1535 |
1536 if kwargs: | 1536 if kwargs: |
1537 raise ValueError(_('unsupported getbundle arguments: %s') | 1537 raise ValueError(_('unsupported getbundle arguments: %s') |
1538 % ', '.join(sorted(kwargs.keys()))) | 1538 % ', '.join(sorted(kwargs.keys()))) |
1539 return changegroup.getchangegroup(repo, source, heads=heads, | 1539 outgoing = changegroup.computeoutgoing(repo, heads, common) |
1540 common=common, bundlecaps=bundlecaps) | 1540 return changegroup.getchangegroup(repo, source, outgoing, |
1541 bundlecaps=bundlecaps) | |
1541 | 1542 |
1542 # bundle20 case | 1543 # bundle20 case |
1543 b2caps = {} | 1544 b2caps = {} |
1544 for bcaps in bundlecaps: | 1545 for bcaps in bundlecaps: |
1545 if bcaps.startswith('bundle2='): | 1546 if bcaps.startswith('bundle2='): |