perftemplating: move template formating into its own function
authorBoris Feld <boris.feld@octobus.net>
Thu, 31 May 2018 17:31:46 +0200
changeset 38254 6b91815fcdce
parent 38253 1b121cc680f2
child 38255 71d59b487d0c
perftemplating: move template formating into its own function The lambda is not practical when time will come to alter the benchmark code.
contrib/perf.py
--- 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()