diff tests/test-upgrade-repo.t @ 48793:6e559391f96e

tracked-key: remove the dual write and rename to tracked-hint The dual-write approach was mostly useless. As explained in the previous version of the help, the key had to be read twice before we could cache a value. However this "read twice" limitation actually also apply to any usage of the key. If some operation wants to rely of the "same value == same tracked set" property it would need to read the value before, and after running that operation (or at least, after, in all cases). So it cannot be sure the operation it did is "valid" until checking the key after the operation. As a resultat such operation can only be read-only or rollbackable. This reduce the utility of the "same value == same tracked set" a lot. So it seems simpler to drop the double write and to update the documentation to highlight that this file does not garantee race-free operation. As a result the "key" is demoted to a "hint". Documentation is updated accordingly. Differential Revision: https://phab.mercurial-scm.org/D12201
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 17 Feb 2022 07:34:49 +0100
parents 5ba24e886cec
children af0b21d5a930
line wrap: on
line diff
--- a/tests/test-upgrade-repo.t	Thu Feb 17 06:41:54 2022 +0100
+++ b/tests/test-upgrade-repo.t	Thu Feb 17 07:34:49 2022 +0100
@@ -214,7 +214,7 @@
   format-variant     repo
   fncache:            yes
   dirstate-v2:         no
-  tracked-key:         no
+  tracked-hint:        no
   dotencode:          yes
   generaldelta:       yes
   share-safe:         yes
@@ -231,7 +231,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -249,7 +249,7 @@
   format-variant     repo config default
   fncache:            yes     no     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes     no     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -267,7 +267,7 @@
   format-variant     repo config default
   [formatvariant.name.mismatchconfig|fncache:           ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special|     no][formatvariant.default|     yes]
   [formatvariant.name.uptodate|dirstate-v2:       ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
-  [formatvariant.name.uptodate|tracked-key:       ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
+  [formatvariant.name.uptodate|tracked-hint:      ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
   [formatvariant.name.mismatchconfig|dotencode:         ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special|     no][formatvariant.default|     yes]
   [formatvariant.name.uptodate|generaldelta:      ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.uptodate|share-safe:        ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
@@ -298,7 +298,7 @@
    {
     "config": false,
     "default": false,
-    "name": "tracked-key",
+    "name": "tracked-hint",
     "repo": false
    },
    {
@@ -498,7 +498,7 @@
   format-variant     repo
   fncache:             no
   dirstate-v2:         no
-  tracked-key:         no
+  tracked-hint:        no
   dotencode:           no
   generaldelta:        no
   share-safe:          no
@@ -514,7 +514,7 @@
   format-variant     repo config default
   fncache:             no    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:           no    yes     yes
   generaldelta:        no    yes     yes
   share-safe:          no    yes     yes
@@ -532,7 +532,7 @@
   format-variant     repo config default
   fncache:             no    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:           no    yes     yes
   generaldelta:        no     no     yes
   share-safe:          no    yes     yes
@@ -550,7 +550,7 @@
   format-variant     repo config default
   [formatvariant.name.mismatchconfig|fncache:           ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.uptodate|dirstate-v2:       ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
-  [formatvariant.name.uptodate|tracked-key:       ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
+  [formatvariant.name.uptodate|tracked-hint:      ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
   [formatvariant.name.mismatchconfig|dotencode:         ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.mismatchdefault|generaldelta:      ][formatvariant.repo.mismatchdefault|  no][formatvariant.config.special|     no][formatvariant.default|     yes]
   [formatvariant.name.mismatchconfig|share-safe:        ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
@@ -1602,7 +1602,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -1646,7 +1646,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -1693,7 +1693,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -1746,7 +1746,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -1796,7 +1796,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes
@@ -1847,7 +1847,7 @@
   format-variant     repo config default
   fncache:            yes    yes     yes
   dirstate-v2:         no     no      no
-  tracked-key:         no     no      no
+  tracked-hint:        no     no      no
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
   share-safe:         yes    yes     yes