Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 39286:331ab85e910b
cleanup: make all uses of timedcm specify what they're timing
It's not used in the timing itself, but it's valuable for the trace
events we emit.
Differential Revision: https://phab.mercurial-scm.org/D4349
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 21 Aug 2018 17:15:51 -0400 |
parents | 497effb0a04a |
children | e00123f63410 |
comparison
equal
deleted
inserted
replaced
39285:497effb0a04a | 39286:331ab85e910b |
---|---|
2927 def foo(a, b, c): | 2927 def foo(a, b, c): |
2928 pass | 2928 pass |
2929 ''' | 2929 ''' |
2930 | 2930 |
2931 def wrapper(*args, **kwargs): | 2931 def wrapper(*args, **kwargs): |
2932 with timedcm() as time_stats: | 2932 with timedcm(pycompat.bytestr(func.__name__)) as time_stats: |
2933 result = func(*args, **kwargs) | 2933 result = func(*args, **kwargs) |
2934 stderr = procutil.stderr | 2934 stderr = procutil.stderr |
2935 stderr.write('%s%s: %s\n' % ( | 2935 stderr.write('%s%s: %s\n' % ( |
2936 ' ' * time_stats.level * 2, pycompat.bytestr(func.__name__), | 2936 ' ' * time_stats.level * 2, pycompat.bytestr(func.__name__), |
2937 time_stats)) | 2937 time_stats)) |