Patchwork D8772: localrepo: abort creating a shared repo if the source does not have store

login
register
mail settings
Submitter phabricator
Date July 21, 2020, 1:42 p.m.
Message ID <differential-rev-PHID-DREV-egjm3n6agbiyaz3p4dzp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46816/
State Superseded
Headers show

Comments

phabricator - July 21, 2020, 1:42 p.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We cannot create a shared repository without a store IIUC. Let's abort in such
  cases.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3663,6 +3663,13 @@ 
             )
             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 does not have 'store' requirement"
+                )
+            )
+
     return dropped