[PATCH 4 of 4 STABLE V3] dispatch: drop the traceback module import in favor of using ui.traceback()

Matt Harbison matt_harbison at yahoo.com
Thu Feb 14 21:57:54 CST 2013


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1360439790 18000
# Branch stable
# Node ID 6e1745620172f71a9ec702939227d509b13c756e
# Parent  531876e328ce07dd3a93ea00e63b00afdfd0b806
dispatch: drop the traceback module import in favor of using ui.traceback()

This ensures chained exception tracebacks are printed when using the
--debugger option.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
-import os, sys, atexit, signal, pdb, socket, errno, shlex, time, traceback, re
+import os, sys, atexit, signal, pdb, socket, errno, shlex, time, re
 import util, commands, hg, fancyopts, extensions, hook, error
 import cmdutil, encoding
 import ui as uimod
@@ -91,7 +91,7 @@
         except: # re-raises
             # enter the debugger when we hit an exception
             if '--debugger' in req.args:
-                traceback.print_exc()
+                ui.traceback(sys.exc_info(), True)
                 pdb.post_mortem(sys.exc_info()[2])
             ui.traceback()
             raise


More information about the Mercurial-devel mailing list