diff 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
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Aug 09 22:31:38 2016 +0200
+++ b/mercurial/commands.py	Tue Aug 09 17:00:38 2016 +0200
@@ -1412,9 +1412,10 @@
                                "a destination"))
         common = [repo.lookup(rev) for rev in base]
         heads = revs and map(repo.lookup, revs) or revs
-        cg = changegroup.getchangegroup(repo, 'bundle', heads=heads,
-                                         common=common, bundlecaps=bundlecaps,
-                                         version=cgversion)
+        outgoing = discovery.outgoing(repo, common, heads)
+        cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
+                                        bundlecaps=bundlecaps,
+                                        version=cgversion)
         outgoing = None
     else:
         dest = ui.expandpath(dest or 'default-push', dest or 'default')