[PATCH 1 of 6] perftemplating: fix the revisions argument

Boris Feld boris.feld at octobus.net
Mon Jun 11 07:52:20 UTC 2018


# HG changeset patch
# User Boris Feld <boris.feld at 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.

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()


More information about the Mercurial-devel mailing list