diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1098,11 +1098,6 @@ ) coreconfigitem( b'experimental', - b'sharesafe-warn-outdated-shares', - default=True, -) -coreconfigitem( - b'experimental', b'single-head-per-branch', default=False, ) @@ -1921,6 +1916,11 @@ default=b'abort', ) coreconfigitem( + b'share', + b'source-safe-mismatch.warn', + default=True, +) +coreconfigitem( b'shelve', b'maxbackups', default=10, diff --git a/mercurial/helptext/config.txt b/mercurial/helptext/config.txt --- a/mercurial/helptext/config.txt +++ b/mercurial/helptext/config.txt @@ -1965,6 +1965,11 @@ source setting +``source-safe-mismatch.warn`` + + Shows warning when upgrade fails and `upgrade-allow` is set. + (default: True) + ``storage`` ----------- diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -568,6 +568,7 @@ # repository was shared the old way. We check the share source .hg/requires # for SHARESAFE_REQUIREMENT to detect whether the current repository needs # to be reshared + mismatch_warn = ui.configbool(b'share', b'source-safe-mismatch.warn') if requirementsmod.SHARESAFE_REQUIREMENT in requirements: if ( @@ -592,6 +593,7 @@ sharedvfs, requirements, mismatch_config, + mismatch_warn, ) elif mismatch_config == b'abort': raise error.Abort( @@ -632,6 +634,7 @@ storevfs, requirements, mismatch_config, + mismatch_warn, ) elif mismatch_config == b'abort': raise error.Abort( diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -242,7 +242,12 @@ def upgrade_share_to_safe( - ui, hgvfs, storevfs, current_requirements, mismatch_config + ui, + hgvfs, + storevfs, + current_requirements, + mismatch_config, + mismatch_warn, ): """Upgrades a share to use share-safe mechanism""" wlock = None @@ -282,7 +287,7 @@ _(b'failed to upgrade share, got error: %s') % stringutil.forcebytestr(e.strerror) ) - elif ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'): + elif mismatch_warn: ui.warn( _(b'failed to upgrade share, got error: %s\n') % stringutil.forcebytestr(e.strerror) @@ -298,6 +303,7 @@ sharedvfs, current_requirements, mismatch_config, + mismatch_warn, ): """Downgrades a share which use share-safe to not use it""" wlock = None @@ -335,6 +341,11 @@ _(b'failed to downgrade share, got error: %s') % stringutil.forcebytestr(e.strerror) ) + elif mismatch_warn: + ui.warn( + _(b'failed to downgrade share, got error: %s\n') + % stringutil.forcebytestr(e.strerror) + ) finally: if wlock: wlock.release() 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 @@ -546,7 +546,7 @@ o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo - $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config experimental.sharesafe-warn-outdated-shares=false + $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.source-safe-mismatch.warn=False @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo