##// END OF EJS Templates
revsetbenchmark: get revision to benchmark in a function...
Pierre-Yves David -
r20853:95293cf6 default
parent child Browse files
Show More
@@ -41,6 +41,16 b' def printrevision(rev):'
41 check_call(['hg', 'log', '--rev', str(rev), '--template',
41 check_call(['hg', 'log', '--rev', str(rev), '--template',
42 '{desc|firstline}\n'])
42 '{desc|firstline}\n'])
43
43
44 def getrevs(spec):
45 """get the list of rev matched by a revset"""
46 try:
47 out = check_output(['hg', 'log', '--template={rev}\n', '--rev', spec])
48 except CalledProcessError, exc:
49 print >> sys.stderr, "abort, can't get revision from %s" % spec
50 sys.exit(exc.returncode)
51 return [r for r in out.split() if r]
52
53
44
54
45 target_rev = sys.argv[1]
55 target_rev = sys.argv[1]
46
56
@@ -59,12 +69,9 b' for idx, rset in enumerate(revsets):'
59 print "----------------------------"
69 print "----------------------------"
60 print
70 print
61
71
62 revs = check_output("hg log --template='{rev}\n' --rev " + target_rev,
63 shell=True)
64
72
65 revs = [r for r in revs.split() if r]
73 revs = getrevs(target_rev)
66
74
67 # Benchmark revisions
68 for r in revs:
75 for r in revs:
69 print "----------------------------"
76 print "----------------------------"
70 printrevision(r)
77 printrevision(r)
General Comments 0
You need to be logged in to leave comments. Login now