diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3334,6 +3334,14 @@ ) dropped.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT) + if b'shared' in requirements or b'relshared' in requirements: + raise error.Abort( + _( + b"cannot create shared repository as source was created" + b" with 'format.usestore' config disabled" + ) + ) + return dropped diff --git a/tests/test-share.t b/tests/test-share.t --- a/tests/test-share.t +++ b/tests/test-share.t @@ -252,3 +252,9 @@ $ killdaemons.py +Test sharing a repository which was created with store requirement disable + + $ hg init nostore --config format.usestore=false + $ hg share nostore sharednostore + abort: cannot create shared repository as source was created with 'format.usestore' config disabled + [255]