diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1272,9 +1272,8 @@ coreconfigitem( ) coreconfigitem( b'format', - b'exp-share-safe', + b'use-share-safe', default=False, - experimental=True, ) coreconfigitem( b'format', diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt --- a/mercurial/helptext/config.txt +++ b/mercurial/helptext/config.txt @@ -914,6 +914,12 @@ https://www.mercurial-scm.org/wiki/Missi 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 diff --git a/mercurial/helptext/internals/requirements.txt b/mercurial/helptext/internals/requirements.txt --- a/mercurial/helptext/internals/requirements.txt +++ b/mercurial/helptext/internals/requirements.txt @@ -159,10 +159,6 @@ keep the index up to date, but will suff 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 sour 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). diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -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, requirem 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" ) diff --git a/mercurial/requirements.py b/mercurial/requirements.py --- a/mercurial/requirements.py +++ b/mercurial/requirements.py @@ -55,7 +55,7 @@ RELATIVE_SHARED_REQUIREMENT = b'relshare # 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 diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py +++ b/mercurial/upgrade_utils/actions.py @@ -237,7 +237,7 @@ class generaldelta(requirementformatvari @registerformatvariant class sharesafe(requirementformatvariant): - name = b'exp-sharesafe' + name = b'share-safe' _requirement = requirements.SHARESAFE_REQUIREMENT default = False diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t --- a/tests/test-copies-chain-merge.t +++ b/tests/test-copies-chain-merge.t @@ -696,7 +696,7 @@ We upgrade a repository that is not usin 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 diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t --- a/tests/test-copies-in-changeset.t +++ b/tests/test-copies-in-changeset.t @@ -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 diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -1553,6 +1553,8 @@ Separate sections from subsections "use-persistent-nodemap" + "use-share-safe" + "usestore" "sparse-revlog" diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t --- a/tests/test-persistent-nodemap.t +++ b/tests/test-persistent-nodemap.t @@ -37,7 +37,7 @@ Unlock further check (we are here to tes 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 diff --git a/tests/test-share-bookmarks.t b/tests/test-share-bookmarks.t --- a/tests/test-share-bookmarks.t +++ b/tests/test-share-bookmarks.t @@ -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 $ 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 !) diff --git a/tests/test-share-safe.t b/tests/test-share-safe.t --- a/tests/test-share-safe.t +++ b/tests/test-share-safe.t @@ -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 requi 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 n 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 n 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 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 wh 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 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 diff --git a/tests/test-share.t b/tests/test-share.t --- a/tests/test-share.t +++ b/tests/test-share.t @@ -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 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] diff --git a/tests/test-sidedata.t b/tests/test-sidedata.t --- a/tests/test-sidedata.t +++ b/tests/test-sidedata.t @@ -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 sidedat 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 sidedat 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 diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -56,7 +56,7 @@ An upgrade of a repository created with 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 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 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 [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 { "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