# HG changeset patch # User Mads Kiilerich # Date 1359942413 -3600 # Node ID e71c2ff93167322e2908a1f9fcec090fb8a53666 # Parent 2e3ec9e6ee6e9b7c61ca178917db6f01582039bc profiling: introduce limit configuration option The number of output lines was hardcoded to 30. There was a 'nested' configuration options that controlled something else related to counting the number of output lines. This introduces the profiling.limit configuration option for controlling the number of profiling output to show. diff -r 2e3ec9e6ee6e -r e71c2ff93167 mercurial/dispatch.py --- a/mercurial/dispatch.py Thu Jan 24 23:57:44 2013 +0100 +++ b/mercurial/dispatch.py Mon Feb 04 02:46:53 2013 +0100 @@ -748,6 +748,7 @@ def lsprofile(ui, func, fp): format = ui.config('profiling', 'format', default='text') field = ui.config('profiling', 'sort', default='inlinetime') + limit = ui.configint('profiling', 'limit', default=30) climit = ui.configint('profiling', 'nested', default=5) if format not in ['text', 'kcachegrind']: @@ -776,7 +777,7 @@ # format == 'text' stats = lsprof.Stats(p.getstats()) stats.sort(field) - stats.pprint(limit=30, file=fp, climit=climit) + stats.pprint(limit=limit, file=fp, climit=climit) def statprofile(ui, func, fp): try: diff -r 2e3ec9e6ee6e -r e71c2ff93167 mercurial/help/config.txt --- a/mercurial/help/config.txt Thu Jan 24 23:57:44 2013 +0100 +++ b/mercurial/help/config.txt Mon Feb 04 02:46:53 2013 +0100 @@ -996,6 +996,10 @@ ``inlinetime``. Default: inlinetime. +``limit`` + Number of lines to show. Specific to the ``ls`` instrumenting profiler. + Default: 30. + ``nested`` Show at most this number of lines of drill-down info in a tree structure after each main entry. This can help explain the difference between Total