Patchwork D11994: requirements: do not warn about dropping share-safe, unless explicitly set

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2022, 2:11 p.m.
Message ID <differential-rev-PHID-DREV-k7fd3pjqdgy5psread3p-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50320/
State New
Headers show

Comments

phabricator - Jan. 12, 2022, 2:11 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  If we are just altering the default value, this is "fine". This will get tested
  once share-safe become the default.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11994

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3726,13 +3726,13 @@ 
             )
 
         if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
-            ui.warn(
-                _(
+            if ui.hasconfig(b'format', b'use-share-safe'):
+                msg = _(
                     b"ignoring enabled 'format.use-share-safe' config because "
                     b"it is incompatible with disabled 'format.usestore'"
                     b" config\n"
                 )
-            )
+                ui.warn(msg)
             dropped.add(requirementsmod.SHARESAFE_REQUIREMENT)
 
     return dropped