[PATCH 2 of 5 STABLE] changegroup: don't support versions 01 and 02 with treemanifests

Martin von Zweigbergk martinvonz at google.com
Wed Jan 20 14:19:11 CST 2016


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1453242438 28800
#      Tue Jan 19 14:27:18 2016 -0800
# Branch stable
# Node ID 14760037c4e4be0a409fdea14fad06d9a8205a66
# Parent  80448db8a1859f4b1f262e1ce4a062477d0053dc
changegroup: don't support versions 01 and 02 with treemanifests

Changegroup 01 and 02 do not support treemanifests, so we should never
use them in repos that use treemanifests.

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -947,12 +947,13 @@
 }
 
 def supportedversions(repo):
-    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')
+    versions = set(_packermap.keys())
+    if ('treemanifest' in repo.requirements or
+        repo.ui.configbool('experimental', 'treemanifest')):
+        versions.discard('01')
+        versions.discard('02')
+    elif not repo.ui.configbool('experimental', 'changegroup3'):
+        versions.discard('03')
     return versions
 
 def getbundler(version, repo, bundlecaps=None):


More information about the Mercurial-devel mailing list