diff -r 2654a0aac80d -r 97bfc2e5fba5 mercurial/dispatch.py --- a/mercurial/dispatch.py Sun Aug 14 16:30:44 2016 -0700 +++ b/mercurial/dispatch.py Sun Aug 14 16:35:58 2016 -0700 @@ -819,6 +819,10 @@ for ui_ in uis: ui_.setconfig('ui', opt, val, '--' + opt) + if options['profile']: + for ui_ in uis: + ui_.setconfig('profiling', 'enabled', 'true', '--profile') + if options['traceback']: for ui_ in uis: ui_.setconfig('ui', 'traceback', 'on', '--traceback') @@ -904,7 +908,7 @@ except error.SignatureError: raise error.CommandError(cmd, _("invalid arguments")) - if options['profile'] or ui.configbool('profiling', 'enabled'): + if ui.configbool('profiling', 'enabled'): return profiling.profile(ui, checkargs) else: return checkargs()