share: move share safe functionality out of experimental
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 18 Jan 2021 19:16:49 +0530
changeset 46337 6e81446bf1d9
parent 46336 4f17773fc6b5
child 46338 9da65e3cf370
share: move share safe functionality out of experimental The share-safe functionality is complete and all configuration options are implemented. The behavior is well discussed on mailing list and in reviews. Let's unmark this as experimental to solve a chichen and egg issue. Differential Revision: https://phab.mercurial-scm.org/D9823
mercurial/configitems.py
mercurial/helptext/config.txt
mercurial/helptext/internals/requirements.txt
mercurial/localrepo.py
mercurial/requirements.py
mercurial/upgrade_utils/actions.py
tests/test-copies-chain-merge.t
tests/test-copies-in-changeset.t
tests/test-help.t
tests/test-persistent-nodemap.t
tests/test-share-bookmarks.t
tests/test-share-safe.t
tests/test-share.t
tests/test-sidedata.t
tests/test-upgrade-repo.t
--- a/mercurial/configitems.py	Fri Jan 15 12:08:07 2021 +0530
+++ b/mercurial/configitems.py	Mon Jan 18 19:16:49 2021 +0530
@@ -1272,9 +1272,8 @@
 )
 coreconfigitem(
     b'format',
-    b'exp-share-safe',
+    b'use-share-safe',
     default=False,
-    experimental=True,
 )
 coreconfigitem(
     b'format',
--- a/mercurial/helptext/config.txt	Fri Jan 15 12:08:07 2021 +0530
+++ b/mercurial/helptext/config.txt	Mon Jan 18 19:16:49 2021 +0530
@@ -914,6 +914,12 @@
 
     Disabled by default.
 
+``use-share-safe``
+    Enable or disable the "share-safe" functionality, which enables shares
+    to read requirements and configuration of its source repository.
+
+    Disabled by default.
+
 ``usestore``
     Enable or disable the "store" repository format which improves
     compatibility with systems that fold case or otherwise mangle
--- a/mercurial/helptext/internals/requirements.txt	Fri Jan 15 12:08:07 2021 +0530
+++ b/mercurial/helptext/internals/requirements.txt	Mon Jan 18 19:16:49 2021 +0530
@@ -159,10 +159,6 @@
 exp-sharesafe
 =============
 
-NOTE: This requirement is for internal development only. The semantics are not
-frozed yet, the feature is experimental. It's not advised to use it for any
-production repository yet.
-
 Represents that the repository can be shared safely. Requirements and config of
 the source repository will be shared.
 Requirements are stored in ``.hg/store`` instead of directly in ``.hg/`` where
@@ -172,5 +168,5 @@
 
 Support for this requirement was added in Mercurial 5.7 (released
 February 2021). The requirement will only be present on repositories that have
-opted in to this format (by having ``format.exp-share-safe=true`` set when
+opted in to this format (by having ``format.use-share-safe=true`` set when
 they were created).
--- a/mercurial/localrepo.py	Fri Jan 15 12:08:07 2021 +0530
+++ b/mercurial/localrepo.py	Mon Jan 18 19:16:49 2021 +0530
@@ -3474,7 +3474,7 @@
 
     # if share-safe is enabled, let's create the new repository with the new
     # requirement
-    if ui.configbool(b'format', b'exp-share-safe'):
+    if ui.configbool(b'format', b'use-share-safe'):
         requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
 
     return requirements
@@ -3513,7 +3513,7 @@
         if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
             ui.warn(
                 _(
-                    b"ignoring enabled 'format.exp-share-safe' config because "
+                    b"ignoring enabled 'format.use-share-safe' config because "
                     b"it is incompatible with disabled 'format.usestore'"
                     b" config\n"
                 )
--- a/mercurial/requirements.py	Fri Jan 15 12:08:07 2021 +0530
+++ b/mercurial/requirements.py	Mon Jan 18 19:16:49 2021 +0530
@@ -55,7 +55,7 @@
 # A repository with share implemented safely. The repository has different
 # store and working copy requirements i.e. both `.hg/requires` and
 # `.hg/store/requires` are present.
-SHARESAFE_REQUIREMENT = b'exp-sharesafe'
+SHARESAFE_REQUIREMENT = b'share-safe'
 
 # List of requirements which are working directory specific
 # These requirements cannot be shared between repositories if they
--- a/mercurial/upgrade_utils/actions.py	Fri Jan 15 12:08:07 2021 +0530
+++ b/mercurial/upgrade_utils/actions.py	Mon Jan 18 19:16:49 2021 +0530
@@ -237,7 +237,7 @@
 
 @registerformatvariant
 class sharesafe(requirementformatvariant):
-    name = b'exp-sharesafe'
+    name = b'share-safe'
     _requirement = requirements.SHARESAFE_REQUIREMENT
 
     default = False
--- a/tests/test-copies-chain-merge.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-copies-chain-merge.t	Mon Jan 18 19:16:49 2021 +0530
@@ -696,7 +696,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no    yes      no
   persistent-nodemap:  no     no      no
--- a/tests/test-copies-in-changeset.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-copies-in-changeset.t	Mon Jan 18 19:16:49 2021 +0530
@@ -37,7 +37,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes    yes      no
   persistent-nodemap:  no     no      no
@@ -51,7 +51,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -419,7 +419,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes    yes      no
   persistent-nodemap:  no     no      no
@@ -445,7 +445,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes    yes      no
   persistent-nodemap:  no     no      no
@@ -473,7 +473,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes    yes      no
   persistent-nodemap:  no     no      no
--- a/tests/test-help.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-help.t	Mon Jan 18 19:16:49 2021 +0530
@@ -1553,6 +1553,8 @@
   
       "use-persistent-nodemap"
   
+      "use-share-safe"
+  
       "usestore"
   
       "sparse-revlog"
--- a/tests/test-persistent-nodemap.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-persistent-nodemap.t	Mon Jan 18 19:16:49 2021 +0530
@@ -37,7 +37,7 @@
   fncache:            yes
   dotencode:          yes
   generaldelta:       yes
-  exp-sharesafe:       no
+  share-safe:          no
   sparserevlog:       yes
   sidedata:            no
   persistent-nodemap: yes
@@ -556,7 +556,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap: yes     no      no
@@ -592,7 +592,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no    yes      no
--- a/tests/test-share-bookmarks.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-share-bookmarks.t	Mon Jan 18 19:16:49 2021 +0530
@@ -3,7 +3,7 @@
 
 #if safe
   $ echo "[format]"         >> $HGRCPATH
-  $ echo "exp-share-safe = True" >> $HGRCPATH
+  $ echo "use-share-safe = True" >> $HGRCPATH
 #endif
 
   $ echo "[extensions]"      >> $HGRCPATH
@@ -290,4 +290,4 @@
 
   $ hg init brokenrepo --config format.bookmarks-in-store=True --config format.usestore=false
   ignoring enabled 'format.bookmarks-in-store' config beacuse it is incompatible with disabled 'format.usestore' config
-  ignoring enabled 'format.exp-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
+  ignoring enabled 'format.use-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
--- a/tests/test-share-safe.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-share-safe.t	Mon Jan 18 19:16:49 2021 +0530
@@ -4,7 +4,7 @@
   > [extensions]
   > share =
   > [format]
-  > exp-share-safe = True
+  > use-share-safe = True
   > [storage]
   > revlog.persistent-nodemap.slow-path=allow
   > EOF
@@ -14,7 +14,7 @@
   $ hg init source
   $ cd source
   $ cat .hg/requires
-  exp-sharesafe
+  share-safe
   $ cat .hg/store/requires
   dotencode
   fncache
@@ -24,10 +24,10 @@
   store
   $ hg debugrequirements
   dotencode
-  exp-sharesafe
   fncache
   generaldelta
   revlogv1
+  share-safe
   sparserevlog
   store
 
@@ -47,24 +47,24 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd shared1
   $ cat .hg/requires
-  exp-sharesafe
+  share-safe
   shared
 
   $ hg debugrequirements -R ../source
   dotencode
-  exp-sharesafe
   fncache
   generaldelta
   revlogv1
+  share-safe
   sparserevlog
   store
 
   $ hg debugrequirements
   dotencode
-  exp-sharesafe
   fncache
   generaldelta
   revlogv1
+  share-safe
   shared
   sparserevlog
   store
@@ -214,7 +214,7 @@
   upgrade will perform the following actions:
   
   requirements
-     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
+     preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store
      added: revlog-compression-zstd
   
   processed revlogs:
@@ -240,8 +240,8 @@
   upgrade will perform the following actions:
   
   requirements
-     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
-     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
+     preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd !)
+     preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd !)
      added: persistent-nodemap
   
   processed revlogs:
@@ -310,7 +310,7 @@
 Test that upgrading using debugupgraderepo works
 =================================================
 
-  $ hg init non-share-safe --config format.exp-share-safe=false
+  $ hg init non-share-safe --config format.use-share-safe=false
   $ cd non-share-safe
   $ hg debugrequirements
   dotencode
@@ -345,7 +345,7 @@
   $ hg debugupgraderepo -q
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
-     added: exp-sharesafe
+     added: share-safe
   
   processed revlogs:
     - all-filelogs
@@ -357,7 +357,7 @@
   
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
-     added: exp-sharesafe
+     added: share-safe
   
   processed revlogs:
     - all-filelogs
@@ -368,15 +368,15 @@
 
   $ hg debugrequirements
   dotencode
-  exp-sharesafe
   fncache
   generaldelta
   revlogv1
+  share-safe
   sparserevlog
   store
 
   $ cat .hg/requires
-  exp-sharesafe
+  share-safe
 
   $ cat .hg/store/requires
   dotencode
@@ -419,13 +419,13 @@
   > [extensions]
   > share =
   > [format]
-  > exp-share-safe = False
+  > use-share-safe = False
   > EOF
 
   $ hg debugupgraderepo -q
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
-     removed: exp-sharesafe
+     removed: share-safe
   
   processed revlogs:
     - all-filelogs
@@ -437,7 +437,7 @@
   
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
-     removed: exp-sharesafe
+     removed: share-safe
   
   processed revlogs:
     - all-filelogs
@@ -507,12 +507,12 @@
 
 Testing automatic upgrade of shares when config is set
 
-  $ hg debugupgraderepo -q --run --config format.exp-share-safe=True
+  $ hg debugupgraderepo -q --run --config format.use-share-safe=True
   upgrade will perform the following actions:
   
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
-     added: exp-sharesafe
+     added: share-safe
   
   processed revlogs:
     - all-filelogs
@@ -522,10 +522,10 @@
   repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
   $ hg debugrequirements
   dotencode
-  exp-sharesafe
   fncache
   generaldelta
   revlogv1
+  share-safe
   sparserevlog
   store
   $ hg log -GT "{node}: {desc}\n" -R ../nss-share
--- a/tests/test-share.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-share.t	Mon Jan 18 19:16:49 2021 +0530
@@ -2,7 +2,7 @@
 
 #if safe
   $ echo "[format]"         >> $HGRCPATH
-  $ echo "exp-share-safe = True" >> $HGRCPATH
+  $ echo "use-share-safe = True" >> $HGRCPATH
 #endif
 
   $ echo "[extensions]"      >> $HGRCPATH
@@ -281,7 +281,7 @@
 Test sharing a repository which was created with store requirement disable
 
   $ hg init nostore --config format.usestore=false
-  ignoring enabled 'format.exp-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
+  ignoring enabled 'format.use-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
   $ hg share nostore sharednostore
   abort: cannot create shared repository as source was created with 'format.usestore' config disabled
   [255]
--- a/tests/test-sidedata.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-sidedata.t	Mon Jan 18 19:16:49 2021 +0530
@@ -54,7 +54,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -67,7 +67,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no    yes      no
   persistent-nodemap:  no     no      no
@@ -86,7 +86,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes     no      no
   persistent-nodemap:  no     no      no
@@ -99,7 +99,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes     no      no
   persistent-nodemap:  no     no      no
--- a/tests/test-upgrade-repo.t	Fri Jan 15 12:08:07 2021 +0530
+++ b/tests/test-upgrade-repo.t	Mon Jan 18 19:16:49 2021 +0530
@@ -56,7 +56,7 @@
   fncache:            yes
   dotencode:          yes
   generaldelta:       yes
-  exp-sharesafe:       no
+  share-safe:          no
   sparserevlog:       yes
   sidedata:            no
   persistent-nodemap:  no
@@ -69,7 +69,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -82,7 +82,7 @@
   fncache:            yes     no     yes
   dotencode:          yes     no     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -95,7 +95,7 @@
   [formatvariant.name.mismatchconfig|fncache:           ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special|     no][formatvariant.default|     yes]
   [formatvariant.name.mismatchconfig|dotencode:         ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special|     no][formatvariant.default|     yes]
   [formatvariant.name.uptodate|generaldelta:      ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
-  [formatvariant.name.uptodate|exp-sharesafe:     ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
+  [formatvariant.name.uptodate|share-safe:        ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
   [formatvariant.name.uptodate|sparserevlog:      ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.uptodate|sidedata:          ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
   [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
@@ -126,7 +126,7 @@
    {
     "config": false,
     "default": false,
-    "name": "exp-sharesafe",
+    "name": "share-safe",
     "repo": false
    },
    {
@@ -301,7 +301,7 @@
   fncache:             no
   dotencode:           no
   generaldelta:        no
-  exp-sharesafe:       no
+  share-safe:          no
   sparserevlog:        no
   sidedata:            no
   persistent-nodemap:  no
@@ -314,7 +314,7 @@
   fncache:             no    yes     yes
   dotencode:           no    yes     yes
   generaldelta:        no    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:        no    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -327,7 +327,7 @@
   fncache:             no    yes     yes
   dotencode:           no    yes     yes
   generaldelta:        no     no     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:        no     no     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -340,7 +340,7 @@
   [formatvariant.name.mismatchconfig|fncache:           ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.mismatchconfig|dotencode:         ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.mismatchdefault|generaldelta:      ][formatvariant.repo.mismatchdefault|  no][formatvariant.config.special|     no][formatvariant.default|     yes]
-  [formatvariant.name.uptodate|exp-sharesafe:     ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
+  [formatvariant.name.uptodate|share-safe:        ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
   [formatvariant.name.mismatchdefault|sparserevlog:      ][formatvariant.repo.mismatchdefault|  no][formatvariant.config.special|     no][formatvariant.default|     yes]
   [formatvariant.name.uptodate|sidedata:          ][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
   [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate|  no][formatvariant.config.default|     no][formatvariant.default|      no]
@@ -1297,7 +1297,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -1333,7 +1333,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -1372,7 +1372,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -1415,7 +1415,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes     no      no
   persistent-nodemap:  no     no      no
@@ -1458,7 +1458,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:            no     no      no
   persistent-nodemap:  no     no      no
@@ -1501,7 +1501,7 @@
   fncache:            yes    yes     yes
   dotencode:          yes    yes     yes
   generaldelta:       yes    yes     yes
-  exp-sharesafe:       no     no      no
+  share-safe:          no     no      no
   sparserevlog:       yes    yes     yes
   sidedata:           yes    yes      no
   persistent-nodemap:  no     no      no