diff mercurial/changegroup.py @ 27752:29cfc474c5fd

changegroup3: introduce experimental.changegroup3 boolean config In order to give us the freedom to change the changegroup3 format, let's hide it behind an experimental config. Since it is required by treemanifests, that will override the cg3 config.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 12 Jan 2016 21:23:45 -0800
parents a40e2f7fe49d
children d4071cc73f46
line wrap: on
line diff
--- a/mercurial/changegroup.py	Tue Jan 12 21:01:06 2016 -0800
+++ b/mercurial/changegroup.py	Tue Jan 12 21:23:45 2016 -0800
@@ -922,7 +922,13 @@
 }
 
 def supportedversions(repo):
-    return _packermap.keys()
+    versions = _packermap.keys()
+    cg3 = ('treemanifest' in repo.requirements or
+           repo.ui.configbool('experimental', 'changegroup3') or
+           repo.ui.configbool('experimental', 'treemanifest'))
+    if not cg3:
+        versions.remove('03')
+    return versions
 
 def getbundler(version, repo, bundlecaps=None):
     assert version in supportedversions(repo)