[PATCH 1 of 7] revsetbenchmarks: support revset starting with a "-"

Boris Feld boris.feld at octobus.net
Tue Jan 15 19:33:20 UTC 2019


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1547478077 -3600
#      Mon Jan 14 16:01:17 2019 +0100
# Node ID d028a9425f028b02f5cff34683c472a14ff8d8d7
# Parent  32ef47b3c91c2913ab13cabf9efcdde3ef137987
# EXP-Topic revset.predicates
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r d028a9425f02
revsetbenchmarks: support revset starting with a "-"

Before this change, there was no strict separation between arguments and the
benchmarked revset. This is easy to fix.

diff --git a/contrib/revsetbenchmarks.py b/contrib/revsetbenchmarks.py
--- a/contrib/revsetbenchmarks.py
+++ b/contrib/revsetbenchmarks.py
@@ -56,9 +56,11 @@ def hg(cmd, repo=None):
 def perf(revset, target=None, contexts=False):
     """run benchmark for this very revset"""
     try:
-        args = ['perfrevset', revset]
+        args = ['perfrevset']
         if contexts:
             args.append('--contexts')
+        args.append('--')
+        args.append(revset)
         output = hg(args, repo=target)
         return parseoutput(output)
     except subprocess.CalledProcessError as exc:


More information about the Mercurial-devel mailing list