Commit e6c4011f authored by Pulkit Goyal's avatar Pulkit Goyal
Browse files

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
parent 73f91ca1354f
Pipeline #16694 failed with stages
in 21 minutes and 48 seconds
......@@ -1272,9 +1272,8 @@ coreconfigitem(
)
coreconfigitem(
b'format',
b'exp-share-safe',
b'use-share-safe',
default=False,
experimental=True,
)
coreconfigitem(
b'format',
......
......@@ -914,6 +914,12 @@ https://www.mercurial-scm.org/wiki/MissingRequirement
Disabled by default.
``use-share-safe``
Enable or disable the "share-safe" functionality which enables shares
to read requirements and configuration of it's source repository.
Disabled by default.
``usestore``
Enable or disable the "store" repository format which improves
compatibility with systems that fold case or otherwise mangle
......
......@@ -159,10 +159,6 @@ keep the index up to date, but will suffer a slowdown.
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 @@ Shares read the ``.hg/hgrc`` of the source repository.
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).
......@@ -3474,7 +3474,7 @@ def newreporequirements(ui, createopts):
# 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 @@ def checkrequirementscompat(ui, requirements):
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"
)
......
......@@ -55,7 +55,7 @@ RELATIVE_SHARED_REQUIREMENT = b'relshared'
# 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
......
......@@ -237,7 +237,7 @@ class generaldelta(requirementformatvariant):
@registerformatvariant
class sharesafe(requirementformatvariant):
name = b'exp-sharesafe'
name = b'share-safe'
_requirement = requirements.SHARESAFE_REQUIREMENT
default = False
......
......@@ -696,7 +696,7 @@ We upgrade a repository that is not using sidedata (the filelog case) and
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
......
......@@ -37,7 +37,7 @@ Check that copies are recorded correctly
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 @@ Check that copies are recorded correctly
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 @@ downgrading (keeping some sidedata)
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 @@ downgrading (keeping some sidedata)
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 @@ upgrading
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
......
......@@ -1553,6 +1553,8 @@ Separate sections from subsections
"use-persistent-nodemap"
"use-share-safe"
"usestore"
"sparse-revlog"
......
......@@ -37,7 +37,7 @@ Unlock further check (we are here to test the feature)
fncache: yes
dotencode: yes
generaldelta: yes
exp-sharesafe: no
share-safe: no
sparserevlog: yes
sidedata: no
persistent-nodemap: yes
......@@ -556,7 +556,7 @@ downgrading
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 @@ upgrading
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
......
......@@ -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 @@ Test that if store is disabled, we drop the bookmarksinstore requirement
$ 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 !)
......@@ -4,7 +4,7 @@ setup
> [extensions]
> share =
> [format]
> exp-share-safe = True
> use-share-safe = True
> [storage]
> revlog.persistent-nodemap.slow-path=allow
> EOF
......@@ -14,7 +14,7 @@ prepare source repo
$ hg init source
$ cd source
$ cat .hg/requires
exp-sharesafe
share-safe
$ cat .hg/store/requires
dotencode
fncache
......@@ -24,10 +24,10 @@ prepare source repo
store
$ hg debugrequirements
dotencode
exp-sharesafe
fncache
generaldelta
revlogv1
share-safe
sparserevlog
store
......@@ -47,24 +47,24 @@ Create a shared repo and check the requirements are shared and read correctly
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 @@ Disable zstd related tests because its not present on pure version
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 @@ Disable zstd related tests because its not present on pure version
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 @@ of current repo is still respected over the config which came from source config
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 @@ Upgrade
$ 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 @@ Upgrade
requirements
preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
added: exp-sharesafe
added: share-safe
processed revlogs:
- all-filelogs
......@@ -368,15 +368,15 @@ Upgrade
$ 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 @@ Test that downgrading works too
> [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 @@ Test that downgrading works too
requirements
preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
removed: exp-sharesafe
removed: share-safe
processed revlogs:
- all-filelogs
......@@ -507,12 +507,12 @@ Testing automatic downgrade of shares when config is set
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 @@ Testing automatic upgrade of shares when config is set
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
......
......@@ -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 @@ Explicitly kill daemons to let the test exit on Windows
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]
......@@ -54,7 +54,7 @@ Check that we can upgrade to sidedata
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 @@ Check that we can upgrade to sidedata
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 @@ Check that we can downgrade from sidedata
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 @@ Check that we can downgrade from sidedata
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
......
......@@ -56,7 +56,7 @@ An upgrade of a repository created with recommended settings only suggests optim
fncache: yes
dotencode: yes
generaldelta: yes
exp-sharesafe: no
share-safe: no
sparserevlog: yes
sidedata: no
persistent-nodemap: no
......@@ -69,7 +69,7 @@ An upgrade of a repository created with recommended settings only suggests optim
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 @@ An upgrade of a repository created with recommended settings only suggests optim
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 @@ An upgrade of a repository created with recommended settings only suggests optim
[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 @@ An upgrade of a repository created with recommended settings only suggests optim
{
"config": false,
"default": false,
"name": "exp-sharesafe",
"name": "share-safe",
"repo": false
},
{
......@@ -301,7 +301,7 @@ Various sub-optimal detections work
fncache: no
dotencode: no
generaldelta: no
exp-sharesafe: no
share-safe: no
sparserevlog: no
sidedata: no
persistent-nodemap: no
......@@ -314,7 +314,7 @@ Various sub-optimal detections work
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 @@ Various sub-optimal detections work
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 @@ Various sub-optimal detections work
[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 @@ upgrade
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 @@ downgrade
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 @@ upgrade from hgrc
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 @@ upgrade
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 @@ downgrade
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 @@ upgrade from hgrc
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment