changeset 32807:54b356d65079

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 12 Jun 2017 17:20:48 +0200
parents 3a4c677cbd6e
children 336700745a5c
files mercurial/profiling.py
diffstat 1 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/profiling.py	Mon Jun 12 17:15:43 2017 +0200
+++ b/mercurial/profiling.py	Mon Jun 12 17:20:48 2017 +0200
@@ -188,26 +188,27 @@
 
         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: