# HG changeset patch # User Pierre-Yves David # Date 2017-06-12 15:20:48 # Node ID 54b356d650797ce766eff90bd135055ffa966aa5 # Parent 3a4c677cbd6e1b2d296cfaa784605d761e2047f0 profile: indent part of '__enter__' We are about to introduce a try except. We start with adding the indent to make the next patch clearer. diff --git a/mercurial/profiling.py b/mercurial/profiling.py --- a/mercurial/profiling.py +++ b/mercurial/profiling.py @@ -188,26 +188,27 @@ class profile(object): self._output = self._ui.config('profiling', 'output') - if self._output == 'blackbox': - self._fp = util.stringio() - elif self._output: - path = self._ui.expandpath(self._output) - self._fp = open(path, 'wb') - else: - self._fpdoclose = False - self._fp = self._ui.ferr + if True: + if self._output == 'blackbox': + self._fp = util.stringio() + elif self._output: + path = self._ui.expandpath(self._output) + self._fp = open(path, 'wb') + else: + self._fpdoclose = False + self._fp = self._ui.ferr - if proffn is not None: - pass - elif profiler == 'ls': - proffn = lsprofile - elif profiler == 'flame': - proffn = flameprofile - else: - proffn = statprofile + if proffn is not None: + pass + elif profiler == 'ls': + proffn = lsprofile + elif profiler == 'flame': + proffn = flameprofile + else: + proffn = statprofile - self._profiler = proffn(self._ui, self._fp) - self._profiler.__enter__() + self._profiler = proffn(self._ui, self._fp) + self._profiler.__enter__() def __exit__(self, exception_type, exception_value, traceback): if self._profiler is None: