Patchwork [1,of,6] perftemplating: fix the revisions argument

login
register
mail settings
Submitter Boris Feld
Date June 11, 2018, 7:52 a.m.
Message ID <2427db1c14de941e9576.1528703540@localhost.localdomain>
Download mbox | patch
Permalink /patch/32050/
State Accepted
Headers show

Comments

Boris Feld - June 11, 2018, 7:52 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1527782715 -7200
#      Thu May 31 18:05:15 2018 +0200
# Node ID 2427db1c14de941e957690f17a0bb040e21dd063
# Parent  7fa3408f83ef1a04e2d23ab6f8498833b450e589
# EXP-Topic perftemplate
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2427db1c14de
perftemplating: fix the revisions argument

Before this change, the argument passed to log where a string instead of a list
of string. This meant only single character rev were supported...

We now properly accepts argument of any length. We also make it possible to
specify multiple REV arguments in the same go.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -898,12 +898,10 @@  def perfmoonwalk(ui, repo, **opts):
     fm.end()
 
 @command('perftemplating', formatteropts)
-def perftemplating(ui, repo, rev=None, **opts):
-    if rev is None:
-        rev=[]
+def perftemplating(ui, repo, *revs, **opts):
     timer, fm = gettimer(ui, opts)
     ui.pushbuffer()
-    timer(lambda: commands.log(ui, repo, rev=rev, date='', user='',
+    timer(lambda: commands.log(ui, repo, rev=revs, date='', user='',
                                template='{date|shortdate} [{rev}:{node|short}]'
                                ' {author|person}: {desc|firstline}\n'))
     ui.popbuffer()