changeset 20454:47fd57f650e5

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
author Lucas Moscovicz <lmoscovicz@fb.com>
date Thu, 30 Jan 2014 16:47:29 -0800
parents 6aa7dcae6bd8
children a2c08adbb86e
files mercurial/revset.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()``