Patchwork D12200: tracked-file: rename the format option to use `use-`

login
register
mail settings
Submitter phabricator
Date Feb. 17, 2022, 10:26 a.m.
Message ID <differential-rev-PHID-DREV-qtao65jmfc4cbdwx4bcb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50537/
State New
Headers show

Comments

phabricator - Feb. 17, 2022, 10:26 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is more consistent with the other options.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




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

Patch

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]
-  > dirstate-tracked-key=yes
+  > use-dirstate-tracked-key=yes
   > EOF
 
   $ hg init tracked-key-test
@@ -172,7 +172,7 @@ 
 
 downgrade
 
-  $ hg debugupgraderepo --config format.dirstate-tracked-key=no --run --quiet
+  $ hg debugupgraderepo --config format.use-dirstate-tracked-key=no --run --quiet
   upgrade will perform the following actions:
   
   requirements
@@ -189,7 +189,7 @@ 
 
 upgrade
 
-  $ hg debugupgraderepo --config format.dirstate-tracked-key=yes --run --quiet
+  $ hg debugupgraderepo --config format.use-dirstate-tracked-key=yes --run --quiet
   upgrade will perform the following actions:
   
   requirements
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"
   
-      "dirstate-tracked-key"
+      "use-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,10 +3695,10 @@ 
         else:
             requirements.add(requirementsmod.SHARED_REQUIREMENT)
 
-    if ui.configbool(b'format', b'dirstate-tracked-key'):
-        version = ui.configint(b'format', b'dirstate-tracked-key.version')
+    if ui.configbool(b'format', b'use-dirstate-tracked-key'):
+        version = ui.configint(b'format', b'use-dirstate-tracked-key.version')
         msg = _("ignoring unknown tracked key version: %d\n")
-        hint = _("see `hg help config.format.exp-dirstate-tracked-key-version")
+        hint = _("see `hg help config.format.use-dirstate-tracked-key-version")
         if version != 1:
             ui.warn(msg % version, hint=hint)
         else:
diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt
--- a/mercurial/helptext/config.txt
+++ b/mercurial/helptext/config.txt
@@ -944,7 +944,7 @@ 
 
     For a more comprehensive guide, see :hg:`help internals.dirstate-v2`.
 
-``dirstate-tracked-key``
+``use-dirstate-tracked-key``
     Enable or disable the writing of "tracked key" file alongside the dirstate.
     (default to disabled)
 
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1279,13 +1279,13 @@ 
 )
 coreconfigitem(
     b'format',
-    b'dirstate-tracked-key',
+    b'use-dirstate-tracked-key',
     default=False,
     experimental=True,
 )
 coreconfigitem(
     b'format',
-    b'dirstate-tracked-key.version',
+    b'use-dirstate-tracked-key.version',
     default=1,
     experimental=True,
 )