Show More
@@ -38,16 +38,19 b' def update(rev):' | |||
|
38 | 38 | print >> sys.stderr, 'update to revision %s failed, aborting' % rev |
|
39 | 39 | sys.exit(exc.returncode) |
|
40 | 40 | |
|
41 | def perf(revset): | |
|
41 | def perf(revset, target=None): | |
|
42 | 42 | """run benchmark for this very revset""" |
|
43 | 43 | try: |
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 | stderr=STDOUT) | |
|
44 | cmd = ['./hg', | |
|
45 | '--config', | |
|
46 | 'extensions.perf=' | |
|
47 | + os.path.join(contribdir, 'perf.py'), | |
|
48 | 'perfrevset', | |
|
49 | revset] | |
|
50 | if target is not None: | |
|
51 | cmd.append('-R') | |
|
52 | cmd.append(target) | |
|
53 | output = check_output(cmd, stderr=STDOUT) | |
|
51 | 54 | output = output.lstrip('!') # remove useless ! in this context |
|
52 | 55 | return output.strip() |
|
53 | 56 | except CalledProcessError, exc: |
@@ -74,6 +77,8 b' def getrevs(spec):' | |||
|
74 | 77 | parser = OptionParser(usage="usage: %prog [options] <revs>") |
|
75 | 78 | parser.add_option("-f", "--file", |
|
76 | 79 | help="read revset from FILE", metavar="FILE") |
|
80 | parser.add_option("-R", "--repo", | |
|
81 | help="run benchmark on REPO", metavar="REPO") | |
|
77 | 82 | |
|
78 | 83 | (options, args) = parser.parse_args() |
|
79 | 84 | |
@@ -113,7 +118,7 b' for r in revs:' | |||
|
113 | 118 | res = [] |
|
114 | 119 | results.append(res) |
|
115 | 120 | for idx, rset in enumerate(revsets): |
|
116 | data = perf(rset) | |
|
121 | data = perf(rset, target=options.repo) | |
|
117 | 122 | res.append(data) |
|
118 | 123 | print "%i)" % idx, data |
|
119 | 124 | sys.stdout.flush() |
General Comments 0
You need to be logged in to leave comments.
Login now