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

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 23, 2015, 9:06 a.m.
Message ID <e3eaa48dc27d4377d314.1450861600@waste.org>
Download mbox | patch
Permalink /patch/12279/
State Superseded
Headers show

Comments

timeless@mozdev.org - Dec. 23, 2015, 9:06 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450860772 0
#      Wed Dec 23 08:52:52 2015 +0000
# Node ID e3eaa48dc27d4377d3146c602eec688c62678993
# Parent  fe376159a58d9b3d748b669ac011b0eed0346fea
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
@@ -265,6 +265,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):