# HG changeset patch # User Arseniy Alekseyev # Date 2022-09-22 20:05:22 # Node ID 3a53871048dcf1254566d24a3b9df3f3f4ba8189 # Parent b3e77d536b537d1ec1cb9c08e73e1ae8f5caf3f4 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. diff --git a/rust/hg-core/src/requirements.rs b/rust/hg-core/src/requirements.rs --- a/rust/hg-core/src/requirements.rs +++ b/rust/hg-core/src/requirements.rs @@ -84,6 +84,7 @@ const SUPPORTED: &[&str] = &[ 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: diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs --- a/rust/rhg/src/main.rs +++ b/rust/rhg/src/main.rs @@ -737,7 +737,7 @@ const AUTO_UPGRADES: &[((&str, &str), (& 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, ), 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 @@ -227,6 +227,11 @@ upgrade it to dirstate-tracked-hint auto $ 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 \