[PATCH 2 of 3 stable] profiling: improve '+' markup of nested lines

Mads Kiilerich mads at kiilerich.com
Tue Jan 29 11:04:52 CST 2013


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1359478615 -3600
# Branch stable
# Node ID 8256fe23401ea99fb8408f3873005a905254ab30
# Parent  5af8588d1a8f449ab5d22e38ac745c3021428f3a
profiling: improve '+' markup of nested lines

The display of nested lines was very non-obvious and made it look like sort
didn't work.

The '+' immediately before CallCount was not related to the CallCount and did
not mean plus in any integer sense.

The '+' before module looked like a part of the module name and not like ascii art.

Instead we now only show '+' before the module name but add a space to make it
look more like ascii art.

diff --git a/mercurial/lsprof.py b/mercurial/lsprof.py
--- a/mercurial/lsprof.py
+++ b/mercurial/lsprof.py
@@ -50,9 +50,9 @@
             ccount = 0
             if climit and e.calls:
                 for se in e.calls:
-                    file.write(cols % ("+%s" % se.callcount, se.reccallcount,
+                    file.write(cols % (se.callcount, se.reccallcount,
                                        se.totaltime, se.inlinetime,
-                                       "+%s" % label(se.code)))
+                                       "+ %s" % label(se.code)))
                     count += 1
                     ccount += 1
                     if limit is not None and count == limit:


More information about the Mercurial-devel mailing list