requirements: do not warn about dropping share-safe, unless explicitly set
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 10 Jan 2022 12:48:35 +0100
changeset 48688 4c1135d15700
parent 48687 a62ba3345534
child 48689 fc80752dbb24
requirements: do not warn about dropping share-safe, unless explicitly set If we are just altering the default value, this is "fine". This will get tested once share-safe become the default. Differential Revision: https://phab.mercurial-scm.org/D11994
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue Jan 11 06:40:44 2022 +0100
+++ b/mercurial/localrepo.py	Mon Jan 10 12:48:35 2022 +0100
@@ -3719,13 +3719,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