perf: add optional rev for perflog and perftemplating
authortimeless <timeless@mozdev.org>
Fri, 04 Dec 2015 18:08:50 +0000
changeset 27306 bafb1235f505
parent 27305 5831cfbf0e33
child 27307 f36dc0062b1a
perf: add optional rev for perflog and perftemplating
contrib/perf.py
--- a/contrib/perf.py	Fri Dec 04 18:18:07 2015 +0000
+++ b/contrib/perf.py	Fri Dec 04 18:08:50 2015 +0000
@@ -368,10 +368,12 @@
 
 @command('perflog',
          [('', 'rename', False, 'ask log to follow renames')] + formatteropts)
-def perflog(ui, repo, **opts):
+def perflog(ui, repo, rev=None, **opts):
+    if rev is None:
+        rev=[]
     timer, fm = gettimer(ui, opts)
     ui.pushbuffer()
-    timer(lambda: commands.log(ui, repo, rev=[], date='', user='',
+    timer(lambda: commands.log(ui, repo, rev=rev, date='', user='',
                                copies=opts.get('rename')))
     ui.popbuffer()
     fm.end()
@@ -391,10 +393,12 @@
     fm.end()
 
 @command('perftemplating', formatteropts)
-def perftemplating(ui, repo, **opts):
+def perftemplating(ui, repo, rev=None, **opts):
+    if rev is None:
+        rev=[]
     timer, fm = gettimer(ui, opts)
     ui.pushbuffer()
-    timer(lambda: commands.log(ui, repo, rev=[], date='', user='',
+    timer(lambda: commands.log(ui, repo, rev=rev, date='', user='',
                                template='{date|shortdate} [{rev}:{node|short}]'
                                ' {author|person}: {desc|firstline}\n'))
     ui.popbuffer()