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

login
register
mail settings
Submitter Boris Feld
Date Jan. 15, 2019, 7:33 p.m.
Message ID <d028a9425f028b02f5cf.1547580800@localhost.localdomain>
Download mbox | patch
Permalink /patch/37756/
State Accepted
Headers show

Comments

Boris Feld - Jan. 15, 2019, 7:33 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.

Patch

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: