revset: added lazyset implementation to date revset
Performance Benchmarking:
$ time hg log -qr "first(date(05/03/2005))"
0:9117c6561b0b
real 0m3.157s
user 0m2.994s
sys 0m0.087s
$ time ./hg log -qr "first(date(05/03/2005))"
0:9117c6561b0b
real 0m0.509s
user 0m0.289s
sys 0m0.070s
--- a/mercurial/revset.py Wed Jan 29 09:22:31 2014 -0800
+++ b/mercurial/revset.py Mon Feb 03 16:02:48 2014 -0800
@@ -582,7 +582,7 @@
# i18n: "date" is a keyword
ds = getstring(x, _("date requires a string"))
dm = util.matchdate(ds)
- return baseset([r for r in subset if dm(repo[r].date()[0])])
+ return lazyset(subset, lambda x: dm(repo[x].date()[0]))
def desc(repo, subset, x):
"""``desc(string)``