From patchwork Fri Nov 14 15:44:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: perf: add perflist to make finding available perf commands easier From: Augie Fackler X-Patchwork-Id: 6732 Message-Id: <481938f95e2a7babaac5.1415979859@arthedain.pit.corp.google.com> To: mercurial-devel@selenic.com Date: Fri, 14 Nov 2014 10:44:19 -0500 # HG changeset patch # User Augie Fackler # Date 1415979725 18000 # Fri Nov 14 10:42:05 2014 -0500 # Node ID 481938f95e2a7babaac569a3288f237ec900a615 # Parent 787ccc893f1fe3fce36debddaa12d3223fa9efc5 perf: add perflist to make finding available perf commands easier diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -1,5 +1,7 @@ # perf.py - performance test routines -'''helper extension to measure performance''' +'''helper extension to measure performance + +Run the perflist subcommand to list available measurements.''' from mercurial import cmdutil, scmutil, util, commands, obsolete from mercurial import repoview, branchmap, merge, copies @@ -9,6 +11,13 @@ import functools cmdtable = {} command = cmdutil.command(cmdtable) +@command('perflist', norepo=True) +def perflist(ui): + for c in cmdtable: + if c == 'perflist': + continue + ui.write('%s\n' % c) + def gettimer(ui, opts=None): """return a timer function and formatter: (timer, formatter)