--- a/contrib/perf.py Sat Nov 21 11:07:30 2015 -0800
+++ b/contrib/perf.py Sat Nov 21 15:39:18 2015 -0800
@@ -463,9 +463,10 @@
fm.end()
@command('perfrevset',
- [('C', 'clear', False, 'clear volatile cache between each call.')]
+ [('C', 'clear', False, 'clear volatile cache between each call.'),
+ ('', 'contexts', False, 'obtain changectx for each revision')]
+ formatteropts, "REVSET")
-def perfrevset(ui, repo, expr, clear=False, **opts):
+def perfrevset(ui, repo, expr, clear=False, contexts=False, **opts):
"""benchmark the execution time of a revset
Use the --clean option if need to evaluate the impact of build volatile
@@ -475,7 +476,10 @@
def d():
if clear:
repo.invalidatevolatilesets()
- for r in repo.revs(expr): pass
+ if contexts:
+ for ctx in repo.set(expr): pass
+ else:
+ for r in repo.revs(expr): pass
timer(d)
fm.end()