[PATCH 6 of 8 V2] getbundle: send highest changegroup format supported by both side
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Oct 17 14:56:30 CDT 2014
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1413550750 -7200
# Fri Oct 17 14:59:10 2014 +0200
# Node ID 6a9148c4306d43f56d2b607b7ff62f08637ca44e
# Parent f71a2dedeb81b6194e2560313384e7d5c0bb1b2b
getbundle: send highest changegroup format supported by both side
When using bundle2, we find the common subset of supported changegroup-packers
and we pick the max of them. This allow to use generaldelta aware changegroup
through bundle2.
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1177,11 +1177,15 @@ def _getbundlechangegrouppart(bundler, r
b2caps=None, heads=None, common=None, **kwargs):
"""add a changegroup part to the requested bundle"""
cg = None
if kwargs.get('cg', True):
# build changegroup bundle here.
- version = '1'
+ cgversions = b2caps.get('b2x:changegroup', ('1',))
+ cgversions = [v for v in cgversions if v in changegroup.packermap]
+ if not cgversions:
+ raise ValueError(_('no common changegroup version'))
+ version = max(cgversions)
cg = changegroup.getchangegroupraw(repo, source, heads=heads,
common=common, bundlecaps=bundlecaps,
version=version)
if cg:
More information about the Mercurial-devel
mailing list