changeset 30299:1e5346313963

statprof: return state from stop() I don't like global variables. Have stop() return the captured state so callers can pass data to the display function.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 04 Nov 2016 20:22:37 -0700
parents d4db88a26ad5
children 42af0590f4b9
files mercurial/statprof.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/statprof.py	Sat Nov 05 13:20:53 2016 +0900
+++ b/mercurial/statprof.py	Fri Nov 04 20:22:37 2016 -0700
@@ -324,6 +324,8 @@
         if statprofpath:
             save_data(statprofpath)
 
+    return state
+
 def save_data(path):
     with open(path, 'w+') as file:
         file.write(str(state.accumulated_time) + '\n')