diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -22,6 +22,7 @@ from . import ( error, obsutil, pycompat, + requirements, scmutil, txnutil, util, @@ -36,11 +37,9 @@ from .utils import ( # custom styles activebookmarklabel = b'bookmarks.active bookmarks.current' -BOOKMARKS_IN_STORE_REQUIREMENT = b'bookmarksinstore' - def bookmarksinstore(repo): - return BOOKMARKS_IN_STORE_REQUIREMENT in repo.requirements + return requirements.BOOKMARKS_IN_STORE_REQUIREMENT in repo.requirements def bookmarksvfs(repo): diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1288,7 +1288,7 @@ class localrepository(object): requirementsmod.CHANGELOGV2_REQUIREMENT, requirementsmod.SPARSEREVLOG_REQUIREMENT, requirementsmod.NODEMAP_REQUIREMENT, - bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT, + requirementsmod.BOOKMARKS_IN_STORE_REQUIREMENT, requirementsmod.SHARESAFE_REQUIREMENT, requirementsmod.DIRSTATE_V2_REQUIREMENT, } @@ -3652,7 +3652,7 @@ def newreporequirements(ui, createopts): requirements.add(b'lfs') if ui.configbool(b'format', b'bookmarks-in-store'): - requirements.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT) + requirements.add(requirementsmod.BOOKMARKS_IN_STORE_REQUIREMENT) if ui.configbool(b'format', b'use-persistent-nodemap'): requirements.add(requirementsmod.NODEMAP_REQUIREMENT) @@ -3704,7 +3704,7 @@ def checkrequirementscompat(ui, requirem dropped = set() if requirementsmod.STORE_REQUIREMENT not in requirements: - if bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT in requirements: + if requirementsmod.BOOKMARKS_IN_STORE_REQUIREMENT in requirements: ui.warn( _( b'ignoring enabled \'format.bookmarks-in-store\' config ' @@ -3712,7 +3712,7 @@ def checkrequirementscompat(ui, requirem b'\'format.usestore\' config\n' ) ) - dropped.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT) + dropped.add(requirementsmod.BOOKMARKS_IN_STORE_REQUIREMENT) if ( requirementsmod.SHARED_REQUIREMENT in requirements diff --git a/mercurial/requirements.py b/mercurial/requirements.py --- a/mercurial/requirements.py +++ b/mercurial/requirements.py @@ -66,6 +66,10 @@ RELATIVE_SHARED_REQUIREMENT = b'relshare # `.hg/store/requires` are present. SHARESAFE_REQUIREMENT = b'share-safe' +# Bookmarks must be stored in the `store` part of the repository and will be +# share accross shares +BOOKMARKS_IN_STORE_REQUIREMENT = b'bookmarksinstore' + # List of requirements which are working directory specific # These requirements cannot be shared between repositories if they # share the same store