diff mercurial/changegroup.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 82e8c86cdd6d
children 8d226db31f20
line wrap: on
line diff
--- a/mercurial/changegroup.py	Tue Aug 09 22:31:38 2016 +0200
+++ b/mercurial/changegroup.py	Tue Aug 09 17:00:38 2016 +0200
@@ -987,7 +987,7 @@
         heads = cl.heads()
     return discovery.outgoing(repo, common, heads)
 
-def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None,
+def getchangegroup(repo, source, outgoing, bundlecaps=None,
                    version='01'):
     """Like changegroupsubset, but returns the set difference between the
     ancestors of heads and the ancestors common.
@@ -997,7 +997,6 @@
     The nodes in common might not all be known locally due to the way the
     current discovery protocol works.
     """
-    outgoing = computeoutgoing(repo, heads, common)
     return getlocalchangegroup(repo, source, outgoing, bundlecaps=bundlecaps,
                                version=version)