##// END OF EJS Templates
profiling: add config option for enabling profiling...
Durham Goode -
r26186:eb2187eb default
parent child Browse files
Show More
@@ -1003,13 +1003,17 b' def statprofile(ui, func, fp):'
1003 statprof.display(fp)
1003 statprof.display(fp)
1004
1004
1005 def _runcommand(ui, options, cmd, cmdfunc):
1005 def _runcommand(ui, options, cmd, cmdfunc):
1006 """Enables the profiler if applicable.
1007
1008 ``profiling.enabled`` - boolean config that enables or disables profiling
1009 """
1006 def checkargs():
1010 def checkargs():
1007 try:
1011 try:
1008 return cmdfunc()
1012 return cmdfunc()
1009 except error.SignatureError:
1013 except error.SignatureError:
1010 raise error.CommandError(cmd, _("invalid arguments"))
1014 raise error.CommandError(cmd, _("invalid arguments"))
1011
1015
1012 if options['profile']:
1016 if options['profile'] or ui.configbool('profiling', 'enabled'):
1013 profiler = os.getenv('HGPROF')
1017 profiler = os.getenv('HGPROF')
1014 if profiler is None:
1018 if profiler is None:
1015 profiler = ui.config('profiling', 'type', default='ls')
1019 profiler = ui.config('profiling', 'type', default='ls')
General Comments 0
You need to be logged in to leave comments. Login now