changeset 30626:438532c99b54

changegroup: simplify 'allsupportedversions' logic Discarding '03' to add it back is a bit strange. Instead we only discard it when needed.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 19 Dec 2016 04:31:13 +0100
parents bcf4a975f93d
children 7ace5304fec5
files mercurial/changegroup.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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