Show More
@@ -36,19 +36,24 b' def update(rev):' | |||||
36 | print >> sys.stderr, 'update to revision %s failed, aborting' % rev |
|
36 | print >> sys.stderr, 'update to revision %s failed, aborting' % rev | |
37 | sys.exit(exc.returncode) |
|
37 | sys.exit(exc.returncode) | |
38 |
|
38 | |||
|
39 | ||||
|
40 | def hg(cmd, repo=None): | |||
|
41 | """run a mercurial command | |||
|
42 | ||||
|
43 | <cmd> is the list of command + argument, | |||
|
44 | <repo> is an optional repository path to run this command in.""" | |||
|
45 | fullcmd = ['./hg'] | |||
|
46 | if repo is not None: | |||
|
47 | fullcmd += ['-R', repo] | |||
|
48 | fullcmd += ['--config', | |||
|
49 | 'extensions.perf=' + os.path.join(contribdir, 'perf.py')] | |||
|
50 | fullcmd += cmd | |||
|
51 | return check_output(fullcmd, stderr=STDOUT) | |||
|
52 | ||||
39 | def perf(revset, target=None): |
|
53 | def perf(revset, target=None): | |
40 | """run benchmark for this very revset""" |
|
54 | """run benchmark for this very revset""" | |
41 | try: |
|
55 | try: | |
42 | cmd = ['./hg', |
|
56 | output = hg(['perfrevset', revset], repo=target) | |
43 | '--config', |
|
|||
44 | 'extensions.perf=' |
|
|||
45 | + os.path.join(contribdir, 'perf.py'), |
|
|||
46 | 'perfrevset', |
|
|||
47 | revset] |
|
|||
48 | if target is not None: |
|
|||
49 | cmd.append('-R') |
|
|||
50 | cmd.append(target) |
|
|||
51 | output = check_output(cmd, stderr=STDOUT) |
|
|||
52 | output = output.lstrip('!') # remove useless ! in this context |
|
57 | output = output.lstrip('!') # remove useless ! in this context | |
53 | return output.strip() |
|
58 | return output.strip() | |
54 | except CalledProcessError, exc: |
|
59 | except CalledProcessError, exc: |
General Comments 0
You need to be logged in to leave comments.
Login now