marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We about about to make revlog section smarter. Moving the code around will 
make
  the next changesets clearer.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py

CHANGE DETAILS

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -45,24 +45,11 @@
         optimize = {}
     repo = repo.unfiltered()
 
-    revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
     specentries = (
         (upgrade_engine.UPGRADE_CHANGELOG, changelog),
         (upgrade_engine.UPGRADE_MANIFEST, manifest),
         (upgrade_engine.UPGRADE_FILELOGS, filelogs),
     )
-    specified = [(y, x) for (y, x) in specentries if x is not None]
-    if specified:
-        # we have some limitation on revlogs to be recloned
-        if any(x for y, x in specified):
-            revlogs = set()
-            for upgrade, enabled in specified:
-                if enabled:
-                    revlogs.add(upgrade)
-        else:
-            # none are enabled
-            for upgrade, __ in specified:
-                revlogs.discard(upgrade)
 
     # Ensure the repository can be upgraded.
     upgrade_actions.check_source_requirements(repo)
@@ -99,6 +86,24 @@
     removedreqs = repo.requirements - newreqs
     addedreqs = newreqs - repo.requirements
 
+    # check if we need to touch revlog and if so, which ones
+
+    revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
+    specified = [(y, x) for (y, x) in specentries if x is not None]
+    if specified:
+        # we have some limitation on revlogs to be recloned
+        if any(x for y, x in specified):
+            revlogs = set()
+            for upgrade, enabled in specified:
+                if enabled:
+                    revlogs.add(upgrade)
+        else:
+            # none are enabled
+            for upgrade, __ in specified:
+                revlogs.discard(upgrade)
+
+    # check the consistency of the revlog selection with the planned action
+
     if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
         incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
             removedreqs | addedreqs



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to