diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py +++ b/mercurial/upgrade_utils/actions.py @@ -33,10 +33,10 @@ requirements.CHANGELOGV2_REQUIREMENT, } - def preservedrequirements(repo): preserved = { requirements.SHARED_REQUIREMENT, + requirements.NARROW_REQUIREMENT, } return preserved & repo.requirements @@ -1004,7 +1004,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 +1024,7 @@ requirements.SHARESAFE_REQUIREMENT, requirements.SPARSEREVLOG_REQUIREMENT, requirements.STORE_REQUIREMENT, + requirements.NARROW_REQUIREMENT, } for name in compression.compengines: engine = compression.compengines[name] diff --git a/tests/test-narrow.t b/tests/test-narrow.t --- a/tests/test-narrow.t +++ b/tests/test-narrow.t @@ -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