perftemplating: move template formating into its own function
The lambda is not practical when time will come to alter the benchmark code.
--- 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()