comparison mercurial/localrepo.py @ 48689:fc80752dbb24

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 11 Jan 2022 09:36:10 +0100
parents 4c1135d15700
children e845537f6adb
comparison
equal deleted inserted replaced
48688:4c1135d15700 48689:fc80752dbb24
3541 3541
3542 The store requirements are unchanged while the working copy requirements 3542 The store requirements are unchanged while the working copy requirements
3543 depends on the configuration 3543 depends on the configuration
3544 """ 3544 """
3545 target_requirements = set() 3545 target_requirements = set()
3546 if not srcrepo.requirements:
3547 # this is a legacy revlog "v0" repository, we cannot do anything fancy
3548 # with it.
3549 return target_requirements
3546 createopts = defaultcreateopts(ui, createopts=createopts) 3550 createopts = defaultcreateopts(ui, createopts=createopts)
3547 for r in newreporequirements(ui, createopts): 3551 for r in newreporequirements(ui, createopts):
3548 if r in requirementsmod.WORKING_DIR_REQUIREMENTS: 3552 if r in requirementsmod.WORKING_DIR_REQUIREMENTS:
3549 target_requirements.add(r) 3553 target_requirements.add(r)
3550 3554