Show More
@@ -3365,7 +3365,7 b' def dispatch(args):' | |||
|
3365 | 3365 | if num: signal.signal(num, catchterm) |
|
3366 | 3366 | |
|
3367 | 3367 | try: |
|
3368 | u = ui.ui() | |
|
3368 | u = ui.ui(traceback='--traceback' in sys.argv[1:]) | |
|
3369 | 3369 | except util.Abort, inst: |
|
3370 | 3370 | sys.stderr.write(_("abort: %s\n") % inst) |
|
3371 | 3371 | return -1 |
@@ -3389,7 +3389,7 b' def dispatch(args):' | |||
|
3389 | 3389 | external.append(mod) |
|
3390 | 3390 | except Exception, inst: |
|
3391 | 3391 | u.warn(_("*** failed to import extension %s: %s\n") % (x[0], inst)) |
|
3392 |
if |
|
|
3392 | if u.traceback: | |
|
3393 | 3393 | traceback.print_exc() |
|
3394 | 3394 | return 1 |
|
3395 | 3395 | continue |
@@ -3417,7 +3417,7 b' def dispatch(args):' | |||
|
3417 | 3417 | atexit.register(print_time) |
|
3418 | 3418 | |
|
3419 | 3419 | u.updateopts(options["verbose"], options["debug"], options["quiet"], |
|
3420 | not options["noninteractive"]) | |
|
3420 | not options["noninteractive"], options["traceback"]) | |
|
3421 | 3421 | |
|
3422 | 3422 | # enter the debugger before command execution |
|
3423 | 3423 | if options['debugger']: |
@@ -3484,7 +3484,7 b' def dispatch(args):' | |||
|
3484 | 3484 | # enter the debugger when we hit an exception |
|
3485 | 3485 | if options['debugger']: |
|
3486 | 3486 | pdb.post_mortem(sys.exc_info()[2]) |
|
3487 |
if |
|
|
3487 | if u.traceback: | |
|
3488 | 3488 | traceback.print_exc() |
|
3489 | 3489 | raise |
|
3490 | 3490 | except ParseError, inst: |
@@ -12,7 +12,7 b' from i18n import gettext as _' | |||
|
12 | 12 | from demandload import * |
|
13 | 13 | demandload(globals(), "appendfile changegroup") |
|
14 | 14 | demandload(globals(), "re lock transaction tempfile stat mdiff errno ui") |
|
15 |
demandload(globals(), "revlog |
|
|
15 | demandload(globals(), "revlog traceback") | |
|
16 | 16 | |
|
17 | 17 | class localrepository(object): |
|
18 | 18 | def __del__(self): |
@@ -117,7 +117,7 b' class localrepository(object):' | |||
|
117 | 117 | '%s\n') % (hname, exc)) |
|
118 | 118 | if throw: |
|
119 | 119 | raise |
|
120 |
if |
|
|
120 | if self.ui.traceback: | |
|
121 | 121 | traceback.print_exc() |
|
122 | 122 | return False |
|
123 | 123 | if not r: |
@@ -12,7 +12,7 b' demandload(globals(), "errno os re socke' | |||
|
12 | 12 | |
|
13 | 13 | class ui(object): |
|
14 | 14 | def __init__(self, verbose=False, debug=False, quiet=False, |
|
15 | interactive=True, parentui=None): | |
|
15 | interactive=True, traceback=False, parentui=None): | |
|
16 | 16 | self.overlay = {} |
|
17 | 17 | if parentui is None: |
|
18 | 18 | # this is the parent of all ui children |
@@ -24,6 +24,7 b' class ui(object):' | |||
|
24 | 24 | self.verbose = self.configbool("ui", "verbose") |
|
25 | 25 | self.debugflag = self.configbool("ui", "debug") |
|
26 | 26 | self.interactive = self.configbool("ui", "interactive", True) |
|
27 | self.traceback = traceback | |
|
27 | 28 | |
|
28 | 29 | self.updateopts(verbose, debug, quiet, interactive) |
|
29 | 30 | self.diffcache = None |
@@ -45,11 +46,12 b' class ui(object):' | |||
|
45 | 46 | return getattr(self.parentui, key) |
|
46 | 47 | |
|
47 | 48 | def updateopts(self, verbose=False, debug=False, quiet=False, |
|
48 | interactive=True): | |
|
49 | interactive=True, traceback=False): | |
|
49 | 50 | self.quiet = (self.quiet or quiet) and not verbose and not debug |
|
50 | 51 | self.verbose = (self.verbose or verbose) or debug |
|
51 | 52 | self.debugflag = (self.debugflag or debug) |
|
52 | 53 | self.interactive = (self.interactive and interactive) |
|
54 | self.traceback = self.traceback or traceback | |
|
53 | 55 | |
|
54 | 56 | def readconfig(self, fn, root=None): |
|
55 | 57 | if isinstance(fn, basestring): |
General Comments 0
You need to be logged in to leave comments.
Login now