mercurial/upgrade.py
branchstable
changeset 46348 4a58561ace0f
parent 46336 4f17773fc6b5
child 46414 16c18d5e5dc8
--- a/mercurial/upgrade.py	Wed Jan 20 12:13:17 2021 +0100
+++ b/mercurial/upgrade.py	Wed Jan 20 12:23:40 2021 +0100
@@ -282,15 +282,20 @@
         scmutil.writerequires(hgvfs, diffrequires)
         ui.warn(_(b'repository upgraded to use share-safe mode\n'))
     except error.LockError as e:
+        hint = _(
+            "see `hg help config.format.use-share-safe` for more information"
+        )
         if mismatch_config == b'upgrade-abort':
             raise error.Abort(
                 _(b'failed to upgrade share, got error: %s')
-                % stringutil.forcebytestr(e.strerror)
+                % stringutil.forcebytestr(e.strerror),
+                hint=hint,
             )
         elif mismatch_warn:
             ui.warn(
                 _(b'failed to upgrade share, got error: %s\n')
-                % stringutil.forcebytestr(e.strerror)
+                % stringutil.forcebytestr(e.strerror),
+                hint=hint,
             )
     finally:
         if wlock:
@@ -334,17 +339,22 @@
         scmutil.writerequires(hgvfs, current_requirements)
         ui.warn(_(b'repository downgraded to not use share-safe mode\n'))
     except error.LockError as e:
+        hint = _(
+            "see `hg help config.format.use-share-safe` for more information"
+        )
         # If upgrade-abort is set, abort when upgrade fails, else let the
         # process continue as `upgrade-allow` is set
         if mismatch_config == b'downgrade-abort':
             raise error.Abort(
                 _(b'failed to downgrade share, got error: %s')
-                % stringutil.forcebytestr(e.strerror)
+                % stringutil.forcebytestr(e.strerror),
+                hint=hint,
             )
         elif mismatch_warn:
             ui.warn(
                 _(b'failed to downgrade share, got error: %s\n')
-                % stringutil.forcebytestr(e.strerror)
+                % stringutil.forcebytestr(e.strerror),
+                hint=hint,
             )
     finally:
         if wlock: