Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/ui.py @ 2335:f0680b2d1d64
add ui.print_exc(), make all traceback printing central.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 22 May 2006 08:47:53 -0700 |
parents | 3dc6f2501dbc |
children | af81d8770620 |
line wrap: on
line diff
--- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -9,7 +9,7 @@ import ConfigParser from i18n import gettext as _ from demandload import * demandload(globals(), "errno getpass os re smtplib socket sys tempfile") -demandload(globals(), "templater util") +demandload(globals(), "templater traceback util") class ui(object): def __init__(self, verbose=False, debug=False, quiet=False, @@ -335,3 +335,11 @@ class ui(object): else: mail = sendmail(self, method) return mail + + def print_exc(self): + '''print exception traceback if traceback printing enabled. + only to call in exception handler. returns true if traceback + printed.''' + if self.traceback: + traceback.print_exc() + return self.traceback