comparison mercurial/commands.py @ 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 142ae01820a3
children 8540133f91a1
comparison
equal deleted inserted replaced
29817:82e8c86cdd6d 29818:d4e026341e16
1410 if dest: 1410 if dest:
1411 raise error.Abort(_("--base is incompatible with specifying " 1411 raise error.Abort(_("--base is incompatible with specifying "
1412 "a destination")) 1412 "a destination"))
1413 common = [repo.lookup(rev) for rev in base] 1413 common = [repo.lookup(rev) for rev in base]
1414 heads = revs and map(repo.lookup, revs) or revs 1414 heads = revs and map(repo.lookup, revs) or revs
1415 cg = changegroup.getchangegroup(repo, 'bundle', heads=heads, 1415 outgoing = discovery.outgoing(repo, common, heads)
1416 common=common, bundlecaps=bundlecaps, 1416 cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
1417 version=cgversion) 1417 bundlecaps=bundlecaps,
1418 version=cgversion)
1418 outgoing = None 1419 outgoing = None
1419 else: 1420 else:
1420 dest = ui.expandpath(dest or 'default-push', dest or 'default') 1421 dest = ui.expandpath(dest or 'default-push', dest or 'default')
1421 dest, branches = hg.parseurl(dest, opts.get('branch')) 1422 dest, branches = hg.parseurl(dest, opts.get('branch'))
1422 other = hg.peer(repo, opts, dest) 1423 other = hg.peer(repo, opts, dest)