# HG changeset patch # User Arseniy Alekseyev # Date 1649788837 -3600 # Node ID a31e9840178e70580a057fdc89b31d0c81c56c9a # Parent 5d205e476057453e6ccd07088872b147a222e295 narrow: support debugupgraderepo Differential Revision: https://phab.mercurial-scm.org/D12542 diff -r 5d205e476057 -r a31e9840178e mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py Tue Apr 05 12:06:32 2022 -0700 +++ b/mercurial/upgrade_utils/actions.py Tue Apr 12 19:40:37 2022 +0100 @@ -37,6 +37,7 @@ def preservedrequirements(repo): preserved = { requirements.SHARED_REQUIREMENT, + requirements.NARROW_REQUIREMENT, } return preserved & repo.requirements @@ -1004,7 +1005,7 @@ def supporteddestrequirements(repo): """Obtain requirements that upgrade supports in the destination. - If the result of the upgrade would create requirements not in this set, + If the result of the upgrade would have requirements not in this set, the upgrade is disallowed. Extensions should monkeypatch this to add their custom requirements. @@ -1024,6 +1025,7 @@ requirements.SHARESAFE_REQUIREMENT, requirements.SPARSEREVLOG_REQUIREMENT, requirements.STORE_REQUIREMENT, + requirements.NARROW_REQUIREMENT, } for name in compression.compengines: engine = compression.compengines[name] diff -r 5d205e476057 -r a31e9840178e tests/test-narrow.t --- a/tests/test-narrow.t Tue Apr 05 12:06:32 2022 -0700 +++ b/tests/test-narrow.t Tue Apr 12 19:40:37 2022 +0100 @@ -71,6 +71,17 @@ updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved +The "narrow" repo requirement is ignored by [debugupgraderepo] + +#if tree + $ (cd should-work; hg debugupgraderepo) + abort: cannot upgrade repository; unsupported source requirement: treemanifest + [255] +#else + $ (cd should-work; hg debugupgraderepo | grep 'no format upgrades found in existing repository') + (no format upgrades found in existing repository) +#endif + Test repo with local changes $ hg clone --narrow ssh://user@dummy/master narrow-local-changes --include d0 --include d3 --include d6 requesting all changes