diff mercurial/upgrade.py @ 46238:9796cf108e4e

sharesafe: make warning about outdated share configurable 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. Differential Revision: https://phab.mercurial-scm.org/D9691
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 08 Jan 2021 21:34:16 +0530
parents eec47efe219d
children d159d0fafa78
line wrap: on
line diff
--- a/mercurial/upgrade.py	Fri Jan 08 18:07:33 2021 +0530
+++ b/mercurial/upgrade.py	Fri Jan 08 21:34:16 2021 +0530
@@ -257,10 +257,11 @@
         current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
         ui.warn(_(b'repository upgraded to use share-safe mode\n'))
     except error.LockError as e:
-        ui.warn(
-            _(b'failed to upgrade share, got error: %s\n')
-            % stringutil.forcebytestr(e.strerror)
-        )
+        if ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
+            ui.warn(
+                _(b'failed to upgrade share, got error: %s\n')
+                % stringutil.forcebytestr(e.strerror)
+            )
     finally:
         if wlock:
             wlock.release()