comparison mercurial/exchange.py @ 25504:60f4e7022ffe

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 07 Jun 2015 15:49:17 -0700
parents 1b7853a1f04e
children 1e37bd83dc66
comparison
equal deleted inserted replaced
25503:1b7853a1f04e 25504:60f4e7022ffe
1292 if cgversions: # 3.1 and 3.2 ship with an empty value 1292 if cgversions: # 3.1 and 3.2 ship with an empty value
1293 cgversions = [v for v in cgversions if v in changegroup.packermap] 1293 cgversions = [v for v in cgversions if v in changegroup.packermap]
1294 if not cgversions: 1294 if not cgversions:
1295 raise ValueError(_('no common changegroup version')) 1295 raise ValueError(_('no common changegroup version'))
1296 version = getcgkwargs['version'] = max(cgversions) 1296 version = getcgkwargs['version'] = max(cgversions)
1297 cg = changegroup.getchangegroupraw(repo, source, heads=heads, 1297 outgoing = changegroup.computeoutgoing(repo, heads, common)
1298 common=common, 1298 cg = changegroup.getlocalchangegroupraw(repo, source, outgoing,
1299 bundlecaps=bundlecaps, 1299 bundlecaps=bundlecaps,
1300 **getcgkwargs) 1300 **getcgkwargs)
1301 1301
1302 if cg: 1302 if cg:
1303 part = bundler.newpart('changegroup', data=cg) 1303 part = bundler.newpart('changegroup', data=cg)
1304 if version is not None: 1304 if version is not None:
1305 part.addparam('version', version) 1305 part.addparam('version', version)