1062 ui_.setconfig(b'ui', opt, val, b'--' + opt) |
1062 ui_.setconfig(b'ui', opt, val, b'--' + opt) |
1063 |
1063 |
1064 if req.earlyoptions[b'profile']: |
1064 if req.earlyoptions[b'profile']: |
1065 for ui_ in uis: |
1065 for ui_ in uis: |
1066 ui_.setconfig(b'profiling', b'enabled', b'true', b'--profile') |
1066 ui_.setconfig(b'profiling', b'enabled', b'true', b'--profile') |
|
1067 elif req.earlyoptions[b'profile'] is False: |
|
1068 # Check for it being set already, so that we don't pollute the config |
|
1069 # with this when using chg in the very common case that it's not |
|
1070 # enabled. |
|
1071 if lui.configbool(b'profiling', b'enabled'): |
|
1072 # Only do this on lui so that `chg foo` with a user config setting |
|
1073 # profiling.enabled=1 still shows profiling information (chg will |
|
1074 # specify `--no-profile` when `hg serve` is starting up, we don't |
|
1075 # want that to propagate to every later invocation). |
|
1076 lui.setconfig(b'profiling', b'enabled', b'false', b'--no-profile') |
1067 |
1077 |
1068 profile = lui.configbool(b'profiling', b'enabled') |
1078 profile = lui.configbool(b'profiling', b'enabled') |
1069 with profiling.profile(lui, enabled=profile) as profiler: |
1079 with profiling.profile(lui, enabled=profile) as profiler: |
1070 # Configure extensions in phases: uisetup, extsetup, cmdtable, and |
1080 # Configure extensions in phases: uisetup, extsetup, cmdtable, and |
1071 # reposetup |
1081 # reposetup |