mercurial/dispatch.py
changeset 26186 eb2187ebdf8a
parent 26142 7332bf4ae959
child 26191 39a0b11158d8
--- a/mercurial/dispatch.py	Mon Sep 07 11:31:44 2015 -0700
+++ b/mercurial/dispatch.py	Mon Sep 07 11:35:40 2015 -0700
@@ -1003,13 +1003,17 @@
         statprof.display(fp)
 
 def _runcommand(ui, options, cmd, cmdfunc):
+    """Enables the profiler if applicable.
+
+    ``profiling.enabled`` - boolean config that enables or disables profiling
+    """
     def checkargs():
         try:
             return cmdfunc()
         except error.SignatureError:
             raise error.CommandError(cmd, _("invalid arguments"))
 
-    if options['profile']:
+    if options['profile'] or ui.configbool('profiling', 'enabled'):
         profiler = os.getenv('HGPROF')
         if profiler is None:
             profiler = ui.config('profiling', 'type', default='ls')