[Updated] D12184: dirstate-tracked-key: update the config value to match latest discussion

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Tue Feb 15 19:52:10 UTC 2022


Closed by commit rHGfd9f2205dd0c: dirstate-tracked-key: update the config value to match latest discussion (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12184?vs=32214&id=32222

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

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/helptext/config.txt
  mercurial/localrepo.py
  tests/test-help.t
  tests/test-status-tracked-key.t

CHANGE DETAILS

diff --git a/tests/test-status-tracked-key.t b/tests/test-status-tracked-key.t
--- a/tests/test-status-tracked-key.t
+++ b/tests/test-status-tracked-key.t
@@ -9,7 +9,7 @@
 
   $ cat << EOF >> $HGRCPATH
   > [format]
-  > exp-dirstate-tracked-key-version=1
+  > dirstate-tracked-key=yes
   > EOF
 
   $ hg init tracked-key-test
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1599,7 +1599,7 @@
   
       "use-dirstate-v2"
   
-      "exp-dirstate-tracked-key-version"
+      "dirstate-tracked-key"
   
       "use-persistent-nodemap"
   
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3695,14 +3695,12 @@
         else:
             requirements.add(requirementsmod.SHARED_REQUIREMENT)
 
-    tracked_key = ui.configint(b'format', b'exp-dirstate-tracked-key-version')
-    if tracked_key:
-        if tracked_key != 1:
-            msg = _("ignoring unknown tracked key version: %d\n")
-            hint = _(
-                "see `hg help config.format.exp-dirstate-tracked-key-version"
-            )
-            ui.warn(msg % tracked_key, hint=hint)
+    if ui.configbool(b'format', b'dirstate-tracked-key'):
+        version = ui.configint(b'format', b'dirstate-tracked-key.version')
+        msg = _("ignoring unknown tracked key version: %d\n")
+        hint = _("see `hg help config.format.exp-dirstate-tracked-key-version")
+        if version != 1:
+            ui.warn(msg % version, hint=hint)
         else:
             requirements.add(requirementsmod.DIRSTATE_TRACKED_KEY_V1)
 
diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt
--- a/mercurial/helptext/config.txt
+++ b/mercurial/helptext/config.txt
@@ -944,16 +944,13 @@
 
     For a more comprehensive guide, see :hg:`help internals.dirstate-v2`.
 
-``exp-dirstate-tracked-key-version``
+``dirstate-tracked-key``
     Enable or disable the writing of "tracked key" file alongside the dirstate.
+    (default to disabled)
 
     That "tracked-key" can help external automations to detect changes to the
     set of tracked files.
 
-    Two values are currently supported:
-    - 0: no file is written (the default),
-    - 1: a file in version "1" is written.
-
     The tracked-key is written in a new `.hg/dirstate-tracked-key`. That file
     contains two lines:
     - the first line is the file version (currently: 1),
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1284,8 +1284,14 @@
 )
 coreconfigitem(
     b'format',
-    b'exp-dirstate-tracked-key-version',
-    default=0,
+    b'dirstate-tracked-key',
+    default=False,
+    experimental=True,
+)
+coreconfigitem(
+    b'format',
+    b'dirstate-tracked-key.version',
+    default=1,
     experimental=True,
 )
 coreconfigitem(



To: marmoute, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220215/ed06c736/attachment-0002.html>


More information about the Mercurial-patches mailing list