Patchwork D10915: upgrade_utils: add support for enabling internal phases during upgrade

login
register
mail settings
Submitter phabricator
Date June 28, 2021, 12:44 p.m.
Message ID <differential-rev-PHID-DREV-i6nchna2mhveudivp2ky-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49229/
State Superseded
Headers show

Comments

phabricator - June 28, 2021, 12:44 p.m.
Mathiasdm created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This makes it possible to start using soft strip on an existing repository,
  if the following is set in the configuration:
  
    [format]
    internal-phase=yes

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade_utils/actions.py

CHANGE DETAILS




To: Mathiasdm, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -235,6 +235,27 @@ 
         b'faster'
     )
 
+@registerformatvariant
+class internalphases(requirementformatvariant):
+    name = b'internalphases'
+
+    _requirement = requirements.INTERNAL_PHASE_REQUIREMENT
+
+    default = False
+    description = _(
+        b'older repositories do not support '
+        b'internal phases, which makes it impossible to '
+        b'use features like "soft strip"'
+    )
+    upgrademessage = _(
+        b'repository will be able to use internal phases, '
+        b'making features like "soft strip" possible'
+    )
+
+    touches_filelogs = False
+    touches_manifests = False
+    touches_changelog = False
+    touches_requirements = True
 
 @registerformatvariant
 class sharesafe(requirementformatvariant):
@@ -979,6 +1000,7 @@ 
         requirements.REVLOGV2_REQUIREMENT,
         requirements.CHANGELOGV2_REQUIREMENT,
         requirements.DIRSTATE_V2_REQUIREMENT,
+        requirements.INTERNAL_PHASE_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -1011,6 +1033,7 @@ 
         requirements.REVLOGV2_REQUIREMENT,
         requirements.CHANGELOGV2_REQUIREMENT,
         requirements.DIRSTATE_V2_REQUIREMENT,
+        requirements.INTERNAL_PHASE_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]