changegroup: simplify 'allsupportedversions' logic
Discarding '03' to add it back is a bit strange. Instead we only discard it when
needed.
--- a/mercurial/changegroup.py Sun Dec 18 01:17:12 2016 +0530
+++ b/mercurial/changegroup.py Mon Dec 19 04:31:13 2016 +0100
@@ -876,10 +876,9 @@
def allsupportedversions(ui):
versions = set(_packermap.keys())
- versions.discard('03')
- if (ui.configbool('experimental', 'changegroup3') or
- ui.configbool('experimental', 'treemanifest')):
- versions.add('03')
+ if not (ui.configbool('experimental', 'changegroup3') or
+ ui.configbool('experimental', 'treemanifest')):
+ versions.discard('03')
return versions
# Changegroup versions that can be applied to the repo