Patchwork D6938: changegroup: use positive logic for treemanifest changegroup3 logic

login
register
mail settings
Submitter phabricator
Date Oct. 6, 2019, 2:26 p.m.
Message ID <958adb3329fccec7ce8bfd726c31b2f2@localhost.localdomain>
Download mbox | patch
Permalink /patch/42011/
State Not Applicable
Headers show

Comments

phabricator - Oct. 6, 2019, 2:26 p.m.
marmoute updated this revision to Diff 16879.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6938?vs=16865&id=16879

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6938/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6938

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -1281,9 +1281,19 @@ 
 
 def allsupportedversions(repo):
     versions = set(_packermap.keys())
-    if not (repo.ui.configbool('experimental', 'changegroup3') or
-            repo.ui.configbool('experimental', 'treemanifest') or
-            'treemanifest' in repo.requirements):
+    needv03 = False
+    if (repo.ui.configbool('experimental', 'changegroup3') or
+        repo.ui.configbool('experimental', 'treemanifest') or
+        'treemanifest' in repo.requirements):
+        # we keep version 03 because we need to to exchange treemanifest data
+        #
+        # we also keep vresion 01 and 02, because it is possible for repo to
+        # contains both normal and tree manifest at the same time. so using
+        # older version to pull data is viable
+        #
+        # (or even to push subset of history)
+        needv03 = True
+    if not needv03:
         versions.discard('03')
     return versions