From patchwork Wed Jan 12 14:11:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11995: legacy-revlog: fix requirement computation when cloning legacy repo From: phabricator X-Patchwork-Id: 50321 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 12 Jan 2022 14:11:39 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The oldest format of repository does not have requirements so we need to treat them differently when cloning such repository. The previous code had issue whenever we start using a working-copy-only requirements. The "legacy" format is signaled using an empty requirements list. If we add working-copy-only requirements to it, this is no longer empty, and no longer legacy. The new code fix this, and will get fully tested in a couple of changeset, once the share-safe become the default. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11995 AFFECTED FILES mercurial/localrepo.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3550,6 +3550,10 @@ depends on the configuration """ target_requirements = set() + if not srcrepo.requirements: + # this is a legacy revlog "v0" repository, we cannot do anything fancy + # with it. + return target_requirements createopts = defaultcreateopts(ui, createopts=createopts) for r in newreporequirements(ui, createopts): if r in requirementsmod.WORKING_DIR_REQUIREMENTS: