Patchwork [4,of,6] perftemplating: move revision argument to flag only

login
register
mail settings
Submitter Boris Feld
Date June 11, 2018, 7:52 a.m.
Message ID <a8dd8972d7b4e809dd95.1528703543@localhost.localdomain>
Download mbox | patch
Permalink /patch/32051/
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 1527785288 -7200
#      Thu May 31 18:48:08 2018 +0200
# Node ID a8dd8972d7b4e809dd9533af7e977ad686b6220c
# Parent  5966c21ead803fb7bf57194b8c8d9714860f00a1
# EXP-Topic perftemplate
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a8dd8972d7b4
perftemplating: move revision argument to flag only

The revision we want to render are less important than the templates. We move
revision specification behind the usual `--rev` flag.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -897,12 +897,14 @@  def perfmoonwalk(ui, repo, **opts):
     timer(moonwalk)
     fm.end()
 
-@command('perftemplating', formatteropts)
-def perftemplating(ui, repo, *revs, **opts):
+@command('perftemplating',
+         [('r', 'rev', [], 'revisions to run the template on'),
+         ] + formatteropts)
+def perftemplating(ui, repo, **opts):
     nullui = ui.copy()
     nullui.fout = open(os.devnull, 'wb')
     nullui.disablepager()
-
+    revs = opts.get('rev')
     def format():
         commands.log(nullui, repo, rev=revs, date='', user='',
                      template='{date|shortdate} [{rev}:{node|short}]'