# HG changeset patch # User Pierre-Yves David # Date 1482117918 -3600 # Node ID a001cd7296a5efd4e3a5975d0bf644ec20ead551 # Parent 7ace5304fec56e4a19679b03972f9f031ad57e38 changegroup: simplify logic around enabling changegroup 03 There was multiple spot that took care of adding '03' as supported changegroup version for different condition. We gather them all in one location for simplicity. The 'supportedincomingversions' function is now doing nothing, but I kept it around because it looks like a great hooking point for extension. (Note that we should probably just get changegroup3 out of experimental now, But that would be a patch with a much wider scope). diff -r 7ace5304fec5 -r a001cd7296a5 mercurial/changegroup.py --- a/mercurial/changegroup.py Mon Dec 19 04:29:33 2016 +0100 +++ b/mercurial/changegroup.py Mon Dec 19 04:25:18 2016 +0100 @@ -877,16 +877,14 @@ def allsupportedversions(repo): versions = set(_packermap.keys()) if not (repo.ui.configbool('experimental', 'changegroup3') or - repo.ui.configbool('experimental', 'treemanifest')): + repo.ui.configbool('experimental', 'treemanifest') or + 'treemanifest' in repo.requirements): versions.discard('03') return versions # Changegroup versions that can be applied to the repo def supportedincomingversions(repo): - versions = allsupportedversions(repo) - if 'treemanifest' in repo.requirements: - versions.add('03') - return versions + return allsupportedversions(repo) # Changegroup versions that can be created from the repo def supportedoutgoingversions(repo): @@ -899,7 +897,6 @@ # support versions 01 and 02. versions.discard('01') versions.discard('02') - versions.add('03') return versions def safeversion(repo):