[PATCH] cmdutil: reveal a few exception tracebacks to the UI

Dan Villiom Podlaski Christiansen danchr at gmail.com
Sat Sep 18 08:31:28 CDT 2010


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1281616780 -7200
# Node ID dd989483b0bc2706f09db9d8cd24a2067159eb7f
# Parent  5d8a0d8e9ecc1f2179521ceeb1528697d1ed31b1
cmdutil: reveal a few exception tracebacks to the UI.

This makes the --traceback option show the traceback for the
originating exception in addition to the traceback for the Abort.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -985,9 +985,11 @@ class changeset_templater(changeset_prin
                                                       **props))
 
         except KeyError, inst:
+            self.ui.traceback()
             msg = _("%s: no key named '%s'")
             raise util.Abort(msg % (self.t.mapfile, inst.args[0]))
         except SyntaxError, inst:
+            self.ui.traceback()
             raise util.Abort('%s: %s' % (self.t.mapfile, inst.args[0]))
 
 def show_changeset(ui, repo, opts, buffered=False):


More information about the Mercurial-devel mailing list