From patchwork Fri Jan 8 16:25:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9691: sharesafe: make warning about outdated share configurable From: phabricator X-Patchwork-Id: 48002 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 8 Jan 2021 16:25:28 +0000 pulkit created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If the source repository upgrades to use sharesafe mode, we show a warning in shares. This patch makes that warning configurable and some might not want their users see this warning. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9691 AFFECTED FILES mercurial/configitems.py mercurial/localrepo.py tests/test-share-safe.t CHANGE DETAILS To: pulkit, #hg-reviewers Cc: mercurial-patches, mercurial-devel 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 @@ -392,6 +392,12 @@ Make sure existing shares still works + $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-warn-outdated-shares=false + @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar + | + o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo + + $ hg log -GT "{node}: {desc}\n" -R ../nss-share warning: source repository supports share-safe functionality. Reshare to upgrade. @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -607,7 +607,9 @@ storevfs, requirements, ) - else: + elif ui.configbool( + b'experimental', b'sharesafe-warn-outdated-shares' + ): ui.warn( _( b'warning: source repository supports share-safe functionality.' diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1084,6 +1084,11 @@ ) coreconfigitem( b'experimental', + b'sharesafe-warn-outdated-shares', + default=True, +) +coreconfigitem( + b'experimental', b'single-head-per-branch', default=False, )