Mercurial > hg-stable
changeset 27307:f36dc0062b1a
perf: add getlen
getlen will return 1 if perf.stub
author | timeless <timeless@mozdev.org> |
---|---|
date | Fri, 04 Dec 2015 19:05:32 +0000 |
parents | bafb1235f505 |
children | 7bc52ac46172 |
files | contrib/perf.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Fri Dec 04 18:08:50 2015 +0000 +++ b/contrib/perf.py Fri Dec 04 19:05:32 2015 +0000 @@ -12,6 +12,11 @@ cmdtable = {} command = cmdutil.command(cmdtable) +def getlen(ui): + if ui.configbool("perf", "stub"): + return lambda x: 1 + return len + def gettimer(ui, opts=None): """return a timer function and formatter: (timer, formatter)