changeset 25535:6d1e456645c9

revsetbenchmarks: fix argument parsing The file doc was saying something, the code was doing something else, the argument validation was doing a third thing. Doc and behavior now comply with the argument defined in the code.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 09 Jun 2015 18:39:55 -0700
parents 43e5a6819aba
children f3f1b4b86b35
files contrib/revsetbenchmarks.py
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/revsetbenchmarks.py	Tue Jun 09 17:15:48 2015 -0700
+++ b/contrib/revsetbenchmarks.py	Tue Jun 09 18:39:55 2015 -0700
@@ -4,11 +4,9 @@
 # defined by parameter. Checkout one by one and run perfrevset with every
 # revset in the list to benchmark its performance.
 #
-# - First argument is a revset of mercurial own repo to runs against.
-# - Second argument is the file from which the revset array will be taken
-#   If second argument is omitted read it from standard input
+# You should run this from the root of your mercurial repository.
 #
-# You should run this from the root of your mercurial repository.
+# call with --help for details
 #
 # This script also does one run of the current version of mercurial installed
 # to compare performance.
@@ -148,15 +146,13 @@
 
 (options, args) = parser.parse_args()
 
-if len(sys.argv) < 2:
+if not args:
     parser.print_help()
     sys.exit(255)
 
 # the directory where both this script and the perf.py extension live.
 contribdir = os.path.dirname(__file__)
 
-target_rev = args[0]
-
 revsetsfile = sys.stdin
 if options.file:
     revsetsfile = open(options.file)
@@ -172,8 +168,9 @@
 print "----------------------------"
 print
 
-
-revs = getrevs(target_rev)
+revs = []
+for a in args:
+    revs.extend(getrevs(a))
 
 results = []
 for r in revs: