##// END OF EJS Templates
revsetbenchmarks: fix argument parsing...
Pierre-Yves David -
r25535:6d1e4566 default
parent child Browse files
Show More
@@ -4,11 +4,9 b''
4 # defined by parameter. Checkout one by one and run perfrevset with every
4 # defined by parameter. Checkout one by one and run perfrevset with every
5 # revset in the list to benchmark its performance.
5 # revset in the list to benchmark its performance.
6 #
6 #
7 # - First argument is a revset of mercurial own repo to runs against.
7 # You should run this from the root of your mercurial repository.
8 # - Second argument is the file from which the revset array will be taken
9 # If second argument is omitted read it from standard input
10 #
8 #
11 # You should run this from the root of your mercurial repository.
9 # call with --help for details
12 #
10 #
13 # This script also does one run of the current version of mercurial installed
11 # This script also does one run of the current version of mercurial installed
14 # to compare performance.
12 # to compare performance.
@@ -148,15 +146,13 b' parser.add_option("-R", "--repo",'
148
146
149 (options, args) = parser.parse_args()
147 (options, args) = parser.parse_args()
150
148
151 if len(sys.argv) < 2:
149 if not args:
152 parser.print_help()
150 parser.print_help()
153 sys.exit(255)
151 sys.exit(255)
154
152
155 # the directory where both this script and the perf.py extension live.
153 # the directory where both this script and the perf.py extension live.
156 contribdir = os.path.dirname(__file__)
154 contribdir = os.path.dirname(__file__)
157
155
158 target_rev = args[0]
159
160 revsetsfile = sys.stdin
156 revsetsfile = sys.stdin
161 if options.file:
157 if options.file:
162 revsetsfile = open(options.file)
158 revsetsfile = open(options.file)
@@ -172,8 +168,9 b' for idx, rset in enumerate(revsets):'
172 print "----------------------------"
168 print "----------------------------"
173 print
169 print
174
170
175
171 revs = []
176 revs = getrevs(target_rev)
172 for a in args:
173 revs.extend(getrevs(a))
177
174
178 results = []
175 results = []
179 for r in revs:
176 for r in revs:
General Comments 0
You need to be logged in to leave comments. Login now