# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1595335887 -19800 # Node ID dc283bc7e033927dec4ebbd7969168f1336d50db # Parent dc457177dbc130b7a87a2a10d9a808be62dbfc1d localrepo: abort creating a shared repo if the source does not have store We cannot create a shared repository without a store IIUC. Let's abort in such cases. Differential Revision: https://phab.mercurial-scm.org/D8772 diff -r dc457177dbc1 -r dc283bc7e033 mercurial/localrepo.py --- a/mercurial/localrepo.py Tue Jul 21 13:58:58 2020 +0530 +++ b/mercurial/localrepo.py Tue Jul 21 18:21:27 2020 +0530 @@ -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 -r dc457177dbc1 -r dc283bc7e033 tests/test-share.t --- a/tests/test-share.t Tue Jul 21 13:58:58 2020 +0530 +++ b/tests/test-share.t Tue Jul 21 18:21:27 2020 +0530 @@ -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]