diff mercurial/localrepo.py @ 46336:4f17773fc6b5

share: rename share-safe warning config Config introduced in previous patch was `share.source-safe-mismatch`. Let's rename the warn as `share.source-safe-mismatch.warn`. While we are here, made sure we have different configs for upgrade and downgrade. Differential Revision: https://phab.mercurial-scm.org/D9786
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 15 Jan 2021 12:08:07 +0530
parents 25be21ec6c65
children 4b0192f592cf
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Jan 18 21:37:20 2021 +0530
+++ b/mercurial/localrepo.py	Fri Jan 15 12:08:07 2021 +0530
@@ -575,6 +575,9 @@
             and requirementsmod.SHARESAFE_REQUIREMENT
             not in _readrequires(sharedvfs, True)
         ):
+            mismatch_warn = ui.configbool(
+                b'share', b'safe-mismatch.source-not-safe.warn'
+            )
             mismatch_config = ui.config(
                 b'share', b'safe-mismatch.source-not-safe'
             )
@@ -592,6 +595,7 @@
                     sharedvfs,
                     requirements,
                     mismatch_config,
+                    mismatch_warn,
                 )
             elif mismatch_config == b'abort':
                 raise error.Abort(
@@ -618,6 +622,9 @@
         sourcerequires = _readrequires(sharedvfs, False)
         if requirementsmod.SHARESAFE_REQUIREMENT in sourcerequires:
             mismatch_config = ui.config(b'share', b'safe-mismatch.source-safe')
+            mismatch_warn = ui.configbool(
+                b'share', b'safe-mismatch.source-safe.warn'
+            )
             if mismatch_config in (
                 b'upgrade-allow',
                 b'allow',
@@ -632,6 +639,7 @@
                     storevfs,
                     requirements,
                     mismatch_config,
+                    mismatch_warn,
                 )
             elif mismatch_config == b'abort':
                 raise error.Abort(