mercurial/upgrade.py
changeset 46239 d159d0fafa78
parent 46238 9796cf108e4e
child 46329 17176f64a03d
--- a/mercurial/upgrade.py	Fri Jan 08 21:34:16 2021 +0530
+++ b/mercurial/upgrade.py	Fri Jan 08 21:47:31 2021 +0530
@@ -257,7 +257,12 @@
         current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
         ui.warn(_(b'repository upgraded to use share-safe mode\n'))
     except error.LockError as e:
-        if ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
+        if ui.configbool(b'experimental', b'sharesafe-auto-upgrade-fail-error'):
+            raise error.Abort(
+                _(b'failed to upgrade share, got error: %s')
+                % stringutil.forcebytestr(e.strerror)
+            )
+        elif ui.configbool(b'experimental', b'sharesafe-warn-outdated-shares'):
             ui.warn(
                 _(b'failed to upgrade share, got error: %s\n')
                 % stringutil.forcebytestr(e.strerror)