diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3645,6 +3645,27 @@ return requirements +def checkrequirementscompat(ui, requirements): + """ Checks compatibility of repository requirements enabled and disabled. + + Returns a set of requirements which needs to be dropped because dependend + requirements are not enabled. Also warns users about it """ + + dropped = set() + + if b'store' not in requirements: + if bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT in requirements: + ui.warn( + _( + b'dropping %s requirement as store is not enabled' + % bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT + ) + ) + dropped.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT) + + return dropped + + def filterknowncreateopts(ui, createopts): """Filters a dict of repo creation options against options that are known. @@ -3719,6 +3740,7 @@ ) requirements = newreporequirements(ui, createopts=createopts) + requirements -= checkrequirementscompat(ui, requirements) wdirvfs = vfsmod.vfs(path, expandpath=True, realpath=True)