# HG changeset patch # User Pierre-Yves David # Date 1641890170 -3600 # Node ID fc80752dbb24636353bcdb4a62cc8fbfd938c449 # Parent 4c1135d157002afdce43fdb21984ceb6d7839af7 legacy-revlog: fix requirement computation when cloning legacy repo 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. Differential Revision: https://phab.mercurial-scm.org/D11995 diff -r 4c1135d15700 -r fc80752dbb24 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Jan 10 12:48:35 2022 +0100 +++ b/mercurial/localrepo.py Tue Jan 11 09:36:10 2022 +0100 @@ -3543,6 +3543,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: