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

Boris Feld boris.feld at octobus.net
Mon Jun 11 03:52:23 EDT 2018


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

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()
 
- at command('perftemplating', formatteropts)
-def perftemplating(ui, repo, *revs, **opts):
+ at 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}]'


More information about the Mercurial-devel mailing list