Mercurial > hg
changeset 38254:6b91815fcdce
perftemplating: move template formating into its own function
The lambda is not practical when time will come to alter the benchmark code.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 31 May 2018 17:31:46 +0200 |
parents | 1b121cc680f2 |
children | 71d59b487d0c |
files | contrib/perf.py |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Thu May 31 18:05:15 2018 +0200 +++ b/contrib/perf.py Thu May 31 17:31:46 2018 +0200 @@ -899,11 +899,14 @@ @command('perftemplating', formatteropts) def perftemplating(ui, repo, *revs, **opts): + def format(): + commands.log(ui, repo, rev=revs, date='', user='', + template='{date|shortdate} [{rev}:{node|short}]' + ' {author|person}: {desc|firstline}\n') + timer, fm = gettimer(ui, opts) ui.pushbuffer() - timer(lambda: commands.log(ui, repo, rev=revs, date='', user='', - template='{date|shortdate} [{rev}:{node|short}]' - ' {author|person}: {desc|firstline}\n')) + timer(format) ui.popbuffer() fm.end()