diff mercurial/upgrade_utils/actions.py @ 48790:5ba24e886cec

tracked-key: make it possible to upgrade to and downgrade from the feature This seems rather important if we want people to start using it. Differential Revision: https://phab.mercurial-scm.org/D12198
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 17 Feb 2022 06:32:03 +0100
parents 6e77083683a7
children 6e559391f96e
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py	Mon Jan 31 18:13:00 2022 +0300
+++ b/mercurial/upgrade_utils/actions.py	Thu Feb 17 06:32:03 2022 +0100
@@ -200,6 +200,29 @@
 
 
 @registerformatvariant
+class dirstatetrackedkey(requirementformatvariant):
+    name = b'tracked-key'
+    _requirement = requirements.DIRSTATE_TRACKED_KEY_V1
+
+    default = False
+
+    description = _(
+        b'Add a small file to help external tooling that watch the tracked set'
+    )
+
+    upgrademessage = _(
+        b'external tools will be informated of potential change in the tracked set'
+    )
+
+    touches_filelogs = False
+    touches_manifests = False
+    touches_changelog = False
+    touches_requirements = True
+    touches_dirstate = True
+    compatible_with_share = True
+
+
+@registerformatvariant
 class dotencode(requirementformatvariant):
     name = b'dotencode'
 
@@ -967,6 +990,7 @@
         requirements.REVLOGV2_REQUIREMENT,
         requirements.CHANGELOGV2_REQUIREMENT,
         requirements.REVLOGV1_REQUIREMENT,
+        requirements.DIRSTATE_TRACKED_KEY_V1,
         requirements.DIRSTATE_V2_REQUIREMENT,
     }
     for name in compression.compengines:
@@ -989,6 +1013,7 @@
     supported = {
         requirements.CHANGELOGV2_REQUIREMENT,
         requirements.COPIESSDC_REQUIREMENT,
+        requirements.DIRSTATE_TRACKED_KEY_V1,
         requirements.DIRSTATE_V2_REQUIREMENT,
         requirements.DOTENCODE_REQUIREMENT,
         requirements.FNCACHE_REQUIREMENT,
@@ -1031,6 +1056,7 @@
         requirements.REVLOGV1_REQUIREMENT,
         requirements.REVLOGV2_REQUIREMENT,
         requirements.CHANGELOGV2_REQUIREMENT,
+        requirements.DIRSTATE_TRACKED_KEY_V1,
         requirements.DIRSTATE_V2_REQUIREMENT,
     }
     for name in compression.compengines: