comparison mercurial/localrepo.py @ 46003:c6a1fa42e325

upgrade: add support to downgrade share safe mode In previous patch we added support to upgrade current repository to use share safe mode. This patch adds support to downgrade to remove share-safe mode. Differential Revision: https://phab.mercurial-scm.org/D9358
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 16 Oct 2020 18:57:55 +0530
parents 89a2afe31e82
children 49b4ab1d9f5e
comparison
equal deleted inserted replaced
46002:705c37f22859 46003:c6a1fa42e325
556 # there exists a `.hg/store/requires` too and we should read it 556 # there exists a `.hg/store/requires` too and we should read it
557 # NOTE: presence of SHARESAFE_REQUIREMENT imply that store requirement 557 # NOTE: presence of SHARESAFE_REQUIREMENT imply that store requirement
558 # is present. We never write SHARESAFE_REQUIREMENT for a repo if store 558 # is present. We never write SHARESAFE_REQUIREMENT for a repo if store
559 # is not present, refer checkrequirementscompat() for that 559 # is not present, refer checkrequirementscompat() for that
560 if requirementsmod.SHARESAFE_REQUIREMENT in requirements: 560 if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
561
562 if (
563 shared
564 and requirementsmod.SHARESAFE_REQUIREMENT
565 not in _readrequires(sharedvfs, True)
566 ):
567 raise error.Abort(
568 _(b"share source does not support exp-sharesafe requirement")
569 )
570
561 if shared: 571 if shared:
562 # This is a shared repo 572 # This is a shared repo
563 storevfs = vfsmod.vfs(sharedvfs.join(b'store')) 573 storevfs = vfsmod.vfs(sharedvfs.join(b'store'))
564 else: 574 else:
565 storevfs = vfsmod.vfs(hgvfs.join(b'store')) 575 storevfs = vfsmod.vfs(hgvfs.join(b'store'))