Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 3014:01454af644b8
load extensions only after the ui object has been completely initialized
This fixes a traceback printed when hg tries to print another traceback
after an extension fails to be loaded. Add a test for that.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 22 Aug 2006 22:49:30 -0300 |
parents | f63667f694de |
children | 2b255c3478dc |
comparison
equal
deleted
inserted
replaced
3013:494521a3f142 | 3014:01454af644b8 |
---|---|
3303 for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM': | 3303 for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM': |
3304 num = getattr(signal, name, None) | 3304 num = getattr(signal, name, None) |
3305 if num: signal.signal(num, catchterm) | 3305 if num: signal.signal(num, catchterm) |
3306 | 3306 |
3307 try: | 3307 try: |
3308 u = ui.ui(traceback='--traceback' in sys.argv[1:], | 3308 u = ui.ui(traceback='--traceback' in sys.argv[1:]) |
3309 readhooks=[load_extensions]) | |
3310 except util.Abort, inst: | 3309 except util.Abort, inst: |
3311 sys.stderr.write(_("abort: %s\n") % inst) | 3310 sys.stderr.write(_("abort: %s\n") % inst) |
3312 return -1 | 3311 return -1 |
3312 | |
3313 load_extensions(u) | |
3314 u.addreadhook(load_extensions) | |
3313 | 3315 |
3314 try: | 3316 try: |
3315 cmd, func, args, options, cmdoptions = parse(u, args) | 3317 cmd, func, args, options, cmdoptions = parse(u, args) |
3316 if options["time"]: | 3318 if options["time"]: |
3317 def get_times(): | 3319 def get_times(): |