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

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2019, 4:07 p.m.
Message ID <differential-rev-PHID-DREV-qmjk3ytmke5ilwr6jr6h-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41890/
State Superseded
Headers show

Comments

phabricator - Oct. 1, 2019, 4:07 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We are about to add more cases, in that context, it is simpler to avoid double
  negative.
  
  En addition, We document the situation for the next soul.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
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