Patchwork [3,of,7] profile: remove now useless indent

login
register
mail settings
Submitter Pierre-Yves David
Date June 12, 2017, 4:17 p.m.
Message ID <9a398916971d4e35674b.1497284267@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21341/
State Accepted
Headers show

Comments

Pierre-Yves David - June 12, 2017, 4:17 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1497280543 -7200
#      Mon Jun 12 17:15:43 2017 +0200
# Node ID 9a398916971d4e35674b525440c86f19e3261902
# Parent  a9f13910ea2972e82c0809fb1f46d42baa1f44d3
# EXP-Topic profile
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 9a398916971d
profile: remove now useless indent

We no longer rely on the value of '_output' so we can remove this conditional.

Patch

diff --git a/mercurial/profiling.py b/mercurial/profiling.py
--- a/mercurial/profiling.py
+++ b/mercurial/profiling.py
@@ -213,14 +213,13 @@  class profile(object):
         if self._profiler is None:
             return
         self._profiler.__exit__(exception_type, exception_value, traceback)
-        if self._output:
-            if self._output == 'blackbox':
-                val = 'Profile:\n%s' % self._fp.getvalue()
-                # ui.log treats the input as a format string,
-                # so we need to escape any % signs.
-                val = val.replace('%', '%%')
-                self._ui.log('profile', val)
-            self._closefp()
+        if self._output == 'blackbox':
+            val = 'Profile:\n%s' % self._fp.getvalue()
+            # ui.log treats the input as a format string,
+            # so we need to escape any % signs.
+            val = val.replace('%', '%%')
+            self._ui.log('profile', val)
+        self._closefp()
 
     def _closefp(self):
         if self._fpdoclose and self._fp is not None: