revset: added lazyset implementation to merge revset
Performance benchmarking:
$ time hg log -qr "first(merge())"
102:
58039eddbdda
real 0m0.276s
user 0m0.208s
sys 0m0.047s
$ time ./hg log -qr "first(merge())"
102:
58039eddbdda
real 0m0.192s
user 0m0.154s
sys 0m0.027s
--- a/mercurial/revset.py Thu Jan 30 16:03:18 2014 -0800
+++ b/mercurial/revset.py Thu Jan 30 16:47:29 2014 -0800
@@ -992,7 +992,7 @@
# i18n: "merge" is a keyword
getargs(x, 0, 0, _("merge takes no arguments"))
cl = repo.changelog
- return baseset([r for r in subset if cl.parentrevs(r)[1] != -1])
+ return lazyset(subset, lambda r: cl.parentrevs(r)[1] != -1)
def branchpoint(repo, subset, x):
"""``branchpoint()``