changeset 20456:9a49feb408f3

revset: added lazyset implementation to public revset Performance Benchmarking: $ time hg log -qr "first(public())" ... real 0m1.184s user 0m1.051s sys 0m0.130s $ time ./hg log -qr "first(public())" ... real 0m0.548s user 0m0.427s sys 0m0.118s
author Lucas Moscovicz <lmoscovicz@fb.com>
date Thu, 30 Jan 2014 17:46:08 -0800
parents a2c08adbb86e
children ed7b674824a3
files mercurial/revset.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Feb 12 01:00:51 2014 +0100
+++ b/mercurial/revset.py	Thu Jan 30 17:46:08 2014 -0800
@@ -1202,7 +1202,7 @@
     # i18n: "public" is a keyword
     getargs(x, 0, 0, _("public takes no arguments"))
     pc = repo._phasecache
-    return baseset([r for r in subset if pc.phase(repo, r) == phases.public])
+    return lazyset(subset, lambda r: pc.phase(repo, r) == phases.public)
 
 def remote(repo, subset, x):
     """``remote([id [,path]])``