Patchwork [4,of,8] contrib/perf: add optional rev for perflog and perftemplating

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 8, 2015, 7:07 a.m.
Message ID <80b1b6ccc3d7931ac3b4.1449558445@waste.org>
Download mbox | patch
Permalink /patch/11927/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 8, 2015, 7:07 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1449252530 0
#      Fri Dec 04 18:08:50 2015 +0000
# Node ID 80b1b6ccc3d7931ac3b4af2ad6d029a461e41bbe
# Parent  0aa3baaf6e82413f8de71625adab1fb1e8460475
contrib/perf: add optional rev for perflog and perftemplating

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -367,10 +367,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()
@@ -390,10 +392,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()