contrib/revsetbenchmarks.sh
changeset 20747 8c89433ccdcf
parent 20746 47fc466825da
child 20830 44e80bf2688f
--- a/contrib/revsetbenchmarks.sh	Fri Mar 14 15:43:55 2014 -0700
+++ b/contrib/revsetbenchmarks.sh	Fri Mar 14 15:47:29 2014 -0700
@@ -4,8 +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 
+# - 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.
 #
@@ -17,7 +18,13 @@
 BASE_PERF="hg perfrevset"
 
 TARGETS=$1
-readarray REVSETS < $2
+shift
+# read from a file or from standard output
+if [ $# -ne 0 ]; then
+    readarray REVSETS < $1
+else
+    readarray REVSETS
+fi
 
 hg update --quiet