##// END OF EJS Templates
dispatch: move detection of profiling earlier during startup
Bryan O'Sullivan -
r30933:69a3c6c8 default
parent child Browse files
Show More
@@ -659,6 +659,15 b' def _dispatch(req):'
659 # imported and commands.table is populated.
659 # imported and commands.table is populated.
660 debugcommands.command
660 debugcommands.command
661
661
662 uis = set([ui, lui])
663
664 if req.repo:
665 uis.add(req.repo.ui)
666
667 if '--profile' in args:
668 for ui_ in uis:
669 ui_.setconfig('profiling', 'enabled', 'true', '--profile')
670
662 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
671 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
663 # reposetup. Programs like TortoiseHg will call _dispatch several
672 # reposetup. Programs like TortoiseHg will call _dispatch several
664 # times so we keep track of configured extensions in _loaded.
673 # times so we keep track of configured extensions in _loaded.
@@ -721,21 +730,12 b' def _dispatch(req):'
721 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
730 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
722 atexit.register(print_time)
731 atexit.register(print_time)
723
732
724 uis = set([ui, lui])
725
726 if req.repo:
727 uis.add(req.repo.ui)
728
729 if options['verbose'] or options['debug'] or options['quiet']:
733 if options['verbose'] or options['debug'] or options['quiet']:
730 for opt in ('verbose', 'debug', 'quiet'):
734 for opt in ('verbose', 'debug', 'quiet'):
731 val = str(bool(options[opt]))
735 val = str(bool(options[opt]))
732 for ui_ in uis:
736 for ui_ in uis:
733 ui_.setconfig('ui', opt, val, '--' + opt)
737 ui_.setconfig('ui', opt, val, '--' + opt)
734
738
735 if options['profile']:
736 for ui_ in uis:
737 ui_.setconfig('profiling', 'enabled', 'true', '--profile')
738
739 if options['traceback']:
739 if options['traceback']:
740 for ui_ in uis:
740 for ui_ in uis:
741 ui_.setconfig('ui', 'traceback', 'on', '--traceback')
741 ui_.setconfig('ui', 'traceback', 'on', '--traceback')
General Comments 0
You need to be logged in to leave comments. Login now