mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
dispatch: set profiling.enabled when profiling is enabled
We do this for other global command arguments. We don't for --profile for reasons that are unknown to me. Probably because nobody has needed it. An upcoming patch will introduce a new consumer of the profiling code. It doesn't have access to command line arguments. So let's set the config option during argument processing. We also remove a check for "options['profile']" because it is now redundant.
This commit is contained in:
parent
bdb3786ca0
commit
1aca3f1e38
@ -819,6 +819,10 @@ def _dispatch(req):
|
|||||||
for ui_ in uis:
|
for ui_ in uis:
|
||||||
ui_.setconfig('ui', opt, val, '--' + opt)
|
ui_.setconfig('ui', opt, val, '--' + opt)
|
||||||
|
|
||||||
|
if options['profile']:
|
||||||
|
for ui_ in uis:
|
||||||
|
ui_.setconfig('profiling', 'enabled', 'true', '--profile')
|
||||||
|
|
||||||
if options['traceback']:
|
if options['traceback']:
|
||||||
for ui_ in uis:
|
for ui_ in uis:
|
||||||
ui_.setconfig('ui', 'traceback', 'on', '--traceback')
|
ui_.setconfig('ui', 'traceback', 'on', '--traceback')
|
||||||
@ -904,7 +908,7 @@ def _runcommand(ui, options, cmd, cmdfunc):
|
|||||||
except error.SignatureError:
|
except error.SignatureError:
|
||||||
raise error.CommandError(cmd, _("invalid arguments"))
|
raise error.CommandError(cmd, _("invalid arguments"))
|
||||||
|
|
||||||
if options['profile'] or ui.configbool('profiling', 'enabled'):
|
if ui.configbool('profiling', 'enabled'):
|
||||||
return profiling.profile(ui, checkargs)
|
return profiling.profile(ui, checkargs)
|
||||||
else:
|
else:
|
||||||
return checkargs()
|
return checkargs()
|
||||||
|
Loading…
Reference in New Issue
Block a user