scmutil: display the optional hint when handling StorageError in catchall()
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 15 Nov 2018 17:50:14 -0500
changeset 40699 4ec8bee15930
parent 40698 2eb48aa0acce
child 40700 8863f08c1630
scmutil: display the optional hint when handling StorageError in catchall() Other than CensoredNodeError (which is also a StorageError), it looks like all exceptions with a hint display them. I'm not sure that it makes sense to have a hint for censored nodes, so I'm not bothering with that. It looks like nobody is using this yet, as the tests don't change.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Thu Nov 15 14:57:26 2018 +0100
+++ b/mercurial/scmutil.py	Thu Nov 15 17:50:14 2018 -0500
@@ -212,6 +212,8 @@
         ui.error(_("abort: file censored %s!\n") % inst)
     except error.StorageError as inst:
         ui.error(_("abort: %s!\n") % inst)
+        if inst.hint:
+            ui.error(_("(%s)\n") % inst.hint)
     except error.InterventionRequired as inst:
         ui.error("%s\n" % inst)
         if inst.hint: