rhg: fix bugs around [use-dirstate-tracked-hint] and repo auto-upgrade
This makes two changes:
- make rhg support the [dirstate-tracked-key-v1] requirement.
I believe rhg never changes the tracked file set, so it's OK that it
doesn't have any logic for writing this file.
- fix the name of [format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories]
config option in rhg, which makes rhg actually honor the auto-upgrade.
These two issues cancelled each other out in tests (auto-upgrade was happening
because [dirstate-tracked-key-v1] forced the fallback, not because of the config),
which is I think why they went unnoticed earlier.
--- a/rust/hg-core/src/requirements.rs Tue Sep 20 13:38:07 2022 -0400
+++ b/rust/hg-core/src/requirements.rs Thu Sep 22 16:05:22 2022 -0400
@@ -84,6 +84,7 @@
RELATIVE_SHARED_REQUIREMENT,
REVLOG_COMPRESSION_ZSTD,
DIRSTATE_V2_REQUIREMENT,
+ DIRSTATE_TRACKED_HINT_V1,
// As of this writing everything rhg does is read-only.
// When it starts writing to the repository, it’ll need to either keep the
// persistent nodemap up to date or remove this entry:
--- a/rust/rhg/src/main.rs Tue Sep 20 13:38:07 2022 -0400
+++ b/rust/rhg/src/main.rs Thu Sep 22 16:05:22 2022 -0400
@@ -737,7 +737,7 @@
requirements::DIRSTATE_TRACKED_HINT_V1,
),
(
- ("use-dirstate-v2", "automatic-upgrade-of-mismatching-repositories"),
+ ("format", "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories"),
("format", "use-dirstate-v2"),
requirements::DIRSTATE_V2_REQUIREMENT,
),
--- a/tests/test-status-tracked-key.t Tue Sep 20 13:38:07 2022 -0400
+++ b/tests/test-status-tracked-key.t Thu Sep 22 16:05:22 2022 -0400
@@ -227,6 +227,11 @@
$ hg debugformat -R auto-upgrade | grep tracked
tracked-hint: yes
+rhg supports this feature
+
+ $ hg status -R auto-upgrade \
+ > --config format.use-dirstate-tracked-hint=yes --config rhg.on-unsupported=abort
+
downgrade it from dirstate-tracked-hint automatically
$ hg status -R auto-upgrade \