exchange: expand usage of getchangegroupraw
authorPierre-Yves David <pierre-yves.david@fb.com>
Sun, 07 Jun 2015 15:49:17 -0700
changeset 25504 60f4e7022ffe
parent 25503 1b7853a1f04e
child 25505 19717d3c8f94
exchange: expand usage of getchangegroupraw The 'getchangegroupraw' is very simple (two lines) so we inline it in its only caller. This exposes the 'outgoing' object of the part generator function, allowing us to add information on the number of changesets contained in the part in a later changeset. Such information is useful for progress bar.
mercurial/exchange.py
--- a/mercurial/exchange.py	Sun Jun 07 15:47:07 2015 -0700
+++ b/mercurial/exchange.py	Sun Jun 07 15:49:17 2015 -0700
@@ -1294,10 +1294,10 @@
             if not cgversions:
                 raise ValueError(_('no common changegroup version'))
             version = getcgkwargs['version'] = max(cgversions)
-        cg = changegroup.getchangegroupraw(repo, source, heads=heads,
-                                           common=common,
-                                           bundlecaps=bundlecaps,
-                                           **getcgkwargs)
+        outgoing = changegroup.computeoutgoing(repo, heads, common)
+        cg = changegroup.getlocalchangegroupraw(repo, source, outgoing,
+                                                bundlecaps=bundlecaps,
+                                                **getcgkwargs)
 
     if cg:
         part = bundler.newpart('changegroup', data=cg)