Patchwork [1,of,2,V2] perf: rename perfrevlog to perfrevlogrevisions

login
register
mail settings
Submitter Gregory Szorc
Date May 28, 2017, 6:13 p.m.
Message ID <1ca1ef5d942aa405bec4.1495995201@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/20997/
State Accepted
Headers show

Comments

Gregory Szorc - May 28, 2017, 6:13 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1495994188 25200
#      Sun May 28 10:56:28 2017 -0700
# Node ID 1ca1ef5d942aa405bec4ae74cbcf3155a5a4033f
# Parent  ad37c569ec8121a99e4cd9da52365b114b82e744
perf: rename perfrevlog to perfrevlogrevisions

We have a couple of commands beginning with "perfrevlog." The
actual "perfrevlog" command actually measures resolving the fulltext
of multiple revisions. So let's rename it to reflect what it actually
does.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -857,12 +857,13 @@  def perfdiffwd(ui, repo, **opts):
         timer(d, title)
     fm.end()
 
-@command('perfrevlog', revlogopts + formatteropts +
+@command('perfrevlogrevisions', revlogopts + formatteropts +
          [('d', 'dist', 100, 'distance between the revisions'),
           ('s', 'startrev', 0, 'revision to start reading at'),
           ('', 'reverse', False, 'read in reverse')],
          '-c|-m|FILE')
-def perfrevlog(ui, repo, file_=None, startrev=0, reverse=False, **opts):
+def perfrevlogrevisions(ui, repo, file_=None, startrev=0, reverse=False,
+                        **opts):
     """Benchmark reading a series of revisions from a revlog.
 
     By default, we read every ``-d/--dist`` revision from 0 to tip of
@@ -870,7 +871,7 @@  def perfrevlog(ui, repo, file_=None, sta
 
     The start revision can be defined via ``-s/--startrev``.
     """
-    rl = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts)
+    rl = cmdutil.openrevlog(repo, 'perfrevlogrevisions', file_, opts)
     rllen = getlen(ui)(rl)
 
     def d():
@@ -907,7 +908,7 @@  def perfrevlogchunks(ui, repo, file_=Non
     This command measures the time it takes to read+decompress and recompress
     chunks in a revlog. It effectively isolates I/O and compression performance.
     For measurements of higher-level operations like resolving revisions,
-    see ``perfrevlog`` and ``perfrevlogrevision``.
+    see ``perfrevlogrevisions`` and ``perfrevlogrevision``.
     """
     rl = cmdutil.openrevlog(repo, 'perfrevlogchunks', file_, opts)
 
diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t
--- a/tests/test-contrib-perf.t
+++ b/tests/test-contrib-perf.t
@@ -95,11 +95,12 @@  perfstatus
                  (no help text available)
    perfphases    benchmark phasesets computation
    perfrawfiles  (no help text available)
-   perfrevlog    Benchmark reading a series of revisions from a revlog.
    perfrevlogchunks
                  Benchmark operations on revlog chunks.
    perfrevlogrevision
                  Benchmark obtaining a revlog revision.
+   perfrevlogrevisions
+                 Benchmark reading a series of revisions from a revlog.
    perfrevrange  (no help text available)
    perfrevset    benchmark the execution time of a revset
    perfstartup   (no help text available)
@@ -146,7 +147,7 @@  perfstatus
   $ hg perfnodelookup 2
   $ hg perfpathcopies 1 2
   $ hg perfrawfiles 2
-  $ hg perfrevlog .hg/store/data/a.i
+  $ hg perfrevlogrevisions .hg/store/data/a.i
   $ hg perfrevlogrevision -m 0
   $ hg perfrevlogchunks -c
   $ hg perfrevrange