def dispatch(args): "run the command specified in args" try: u = _ui.ui() if '--traceback' in args: u.setconfig('ui', 'traceback', 'on') if '--debugger' in args: pdb.set_trace() return _runcatch(u, args) except SystemExit: pass except KeyboardInterrupt: print _('\nCaught keyboard interrupt, aborting.\n') except: from tortoisehg.hgtk.bugreport import run if '--debugger' in args: pdb.post_mortem(sys.exc_info()[2]) error = traceback.format_exc() opts = {} opts['cmd'] = ' '.join(sys.argv[1:]) opts['error'] = error opts['nofork'] = True if gtkmainalive: dlg = run(u, **opts) dlg.display() dlg.show_all() else: gtkrun(run, u, **opts)
def thgstatus(ui, *pats, **opts): """update TortoiseHg status cache""" from tortoisehg.util.thgstatus import run run(ui, *pats, **opts)