perf-bundle: accept --rev arguments
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 11 Jul 2022 23:10:55 +0200
changeset 49412 3635aae8b2e9
parent 49411 b081a5aab782
child 49413 b380583ad2f5
perf-bundle: accept --rev arguments This is fairly standard nowaday.
contrib/perf.py
--- a/contrib/perf.py	Mon Jul 11 22:50:59 2022 +0200
+++ b/contrib/perf.py	Mon Jul 11 23:10:55 2022 +0200
@@ -974,7 +974,20 @@
     fm.end()
 
 
-@command(b'perf::bundle', formatteropts, b'REVS')
+@command(
+    b'perf::bundle',
+    [
+        (
+            b'r',
+            b'rev',
+            [],
+            b'changesets to bundle',
+            b'REV',
+        ),
+    ]
+    + formatteropts,
+    b'REVS',
+)
 def perfbundle(ui, repo, *revs, **opts):
     """benchmark the creation of a bundle from a repository
 
@@ -988,6 +1001,8 @@
     timer, fm = gettimer(ui, opts)
 
     cl = repo.changelog
+    revs = list(revs)
+    revs.extend(opts.get(b'rev', ()))
     revs = scmutil.revrange(repo, revs)
     if not revs:
         raise error.Abort(b"not revision specified")