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