[Updated] D8772: localrepo: abort creating a shared repo if the source does not have store

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Aug 1 14:35:49 UTC 2020


pulkit marked an inline comment as done.
pulkit updated this revision to Diff 22170.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8772?vs=22067&id=22170

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8772/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8772

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-share.t

CHANGE DETAILS

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]
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
 
 



To: pulkit, #hg-reviewers
Cc: martinvonz, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200801/963d86c0/attachment-0002.html>


More information about the Mercurial-patches mailing list