comparison mercurial/dispatch.py @ 11494:2347513f562a

debugger: show traceback before entering pdb post-mortem
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 30 Jun 2010 17:20:42 +0200
parents 713ae78bb583
children 6ee107782018
comparison
equal deleted inserted replaced
11493:cc4e2a7ca23f 11494:2347513f562a
4 # 4 #
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from i18n import _ 8 from i18n import _
9 import os, sys, atexit, signal, pdb, socket, errno, shlex, time 9 import os, sys, atexit, signal, pdb, socket, errno, shlex, time, traceback
10 import util, commands, hg, fancyopts, extensions, hook, error 10 import util, commands, hg, fancyopts, extensions, hook, error
11 import cmdutil, encoding 11 import cmdutil, encoding
12 import ui as uimod 12 import ui as uimod
13 13
14 def run(): 14 def run():
55 finally: 55 finally:
56 ui.flush() 56 ui.flush()
57 except: 57 except:
58 # enter the debugger when we hit an exception 58 # enter the debugger when we hit an exception
59 if '--debugger' in args: 59 if '--debugger' in args:
60 traceback.print_exc()
60 pdb.post_mortem(sys.exc_info()[2]) 61 pdb.post_mortem(sys.exc_info()[2])
61 ui.traceback() 62 ui.traceback()
62 raise 63 raise
63 64
64 # Global exception handling, alphabetically 65 # Global exception handling, alphabetically