Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgwebdir_mod.py @ 32808: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/hgwebdir_mod.py Fri Jun 09 12:36:07 2017 +0100 +++ b/mercurial/hgweb/hgwebdir_mod.py Fri Jun 09 12:29:29 2017 +0100 @@ -220,7 +220,8 @@ return False def run_wsgi(self, req): - with profiling.maybeprofile(self.ui): + profile = self.ui.configbool('profiling', 'enabled') + with profiling.profile(self.ui, enabled=profile): for r in self._runwsgi(req): yield r