diff mercurial/hgweb/hgweb_mod.py @ 32788:eede022fc142

profile: drop maybeprofile It seems sufficiently simple to use "profile(enabled=X)" to not justify having a dedicated context manager just to read the config. (I do not have a too strong opinion about this).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 09 Jun 2017 12:29:29 +0100
parents bd3cb917761a
children c8f212cb0c83
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Fri Jun 09 12:36:07 2017 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Jun 09 12:29:29 2017 +0100
@@ -311,7 +311,8 @@
         should be using instances of this class as the WSGI application.
         """
         with self._obtainrepo() as repo:
-            with profiling.maybeprofile(repo.ui):
+            profile = repo.ui.configbool('profiling', 'enabled')
+            with profiling.profile(repo.ui, enabled=profile):
                 for r in self._runwsgi(req, repo):
                     yield r