# HG changeset patch # User Pierre-Yves David # Date 2022-01-11 08:36:10 # 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 --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3543,6 +3543,10 @@ def clone_requirements(ui, createopts, s 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: