# HG changeset patch # User Gregory Szorc # Date 1471224523 25200 # Node ID 88d3c1ab03a71a5aa9132a2ebf0a962e25cd98b6 # Parent e3501546f7e4a75892a0cbb65a0755bdb41bfccf profiling: don't error with statprof when profiling has already started statprof.reset() asserts if profiling has already started. So don't call if it profiling is already running. diff -r e3501546f7e4 -r 88d3c1ab03a7 mercurial/profiling.py --- a/mercurial/profiling.py Sun Aug 14 17:51:12 2016 -0700 +++ b/mercurial/profiling.py Sun Aug 14 18:28:43 2016 -0700 @@ -88,7 +88,9 @@ freq = ui.configint('profiling', 'freq', default=1000) if freq > 0: - statprof.reset(freq) + # Cannot reset when profiler is already active. So silently no-op. + if statprof.state.profile_level == 0: + statprof.reset(freq) else: ui.warn(_("invalid sampling frequency '%s' - ignoring\n") % freq)