Patchwork [1,of,7,v2] error: make InterventionRequired take a hint

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 28, 2015, 7:14 p.m.
Message ID <f5b78b6b31159cc6c00a.1451330097@waste.org>
Download mbox | patch
Permalink /patch/12371/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 28, 2015, 7:14 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450860772 0
#      Wed Dec 23 08:52:52 2015 +0000
# Node ID f5b78b6b31159cc6c00aa729a974117e51f20b7c
# Parent  23541bdd1610c08af247f9c8719045cf247ce541
error: make InterventionRequired take a hint

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -269,6 +269,8 @@ 
                 commands.help_(ui, 'shortlist')
     except error.InterventionRequired as inst:
         ui.warn("%s\n" % inst)
+        if inst.hint:
+            ui.warn(_("(%s)\n") % inst.hint)
         return 1
     except error.Abort as inst:
         ui.warn(_("abort: %s\n") % inst)
diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -50,7 +50,7 @@ 
 class CommandError(Exception):
     """Exception raised on errors in parsing the command line."""
 
-class InterventionRequired(Exception):
+class InterventionRequired(HintException):
     """Exception raised when a command requires human intervention."""
 
 class Abort(HintException):