comparison mercurial/revset.py @ 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 47fd57f650e5
children ed7b674824a3
comparison
equal deleted inserted replaced
20455:a2c08adbb86e 20456:9a49feb408f3
1200 """``public()`` 1200 """``public()``
1201 Changeset in public phase.""" 1201 Changeset in public phase."""
1202 # i18n: "public" is a keyword 1202 # i18n: "public" is a keyword
1203 getargs(x, 0, 0, _("public takes no arguments")) 1203 getargs(x, 0, 0, _("public takes no arguments"))
1204 pc = repo._phasecache 1204 pc = repo._phasecache
1205 return baseset([r for r in subset if pc.phase(repo, r) == phases.public]) 1205 return lazyset(subset, lambda r: pc.phase(repo, r) == phases.public)
1206 1206
1207 def remote(repo, subset, x): 1207 def remote(repo, subset, x):
1208 """``remote([id [,path]])`` 1208 """``remote([id [,path]])``
1209 Local revision that corresponds to the given identifier in a 1209 Local revision that corresponds to the given identifier in a
1210 remote repository, if present. Here, the '.' identifier is a 1210 remote repository, if present. Here, the '.' identifier is a