mercurial/error.py
changeset 45885 600aec73f309
parent 45884 98399dd1b96c
child 45887 7eb221b9af6c
--- a/mercurial/error.py	Fri Nov 20 08:51:45 2020 -0800
+++ b/mercurial/error.py	Fri Nov 20 09:17:38 2020 -0800
@@ -182,6 +182,14 @@
             # may raise another exception.
             return pycompat.sysstr(self.__bytes__())
 
+    def format(self):
+        from .i18n import _
+
+        message = _(b"abort: %s\n") % self.message
+        if self.hint:
+            message += _(b"(%s)\n") % self.hint
+        return message
+
 
 class InputError(Abort):
     """Indicates that the user made an error in their input.