# HG changeset patch # User Lucas Moscovicz # Date 2014-01-29 17:22:31 # Node ID 92f6f2db3cf475e7a1f20f7e1a78cf41b49985b5 # Parent abb91b74f75872f0345b5b333a975d2bc7e92612 revset: added lazyset implementation to author revset Performance benchmarking: $ time hg log -qr "first(author(mpm))" 0:9117c6561b0b real 0m3.486s user 0m3.317s sys 0m0.077s $ time ./hg log -qr "first(author(mpm))" 0:9117c6561b0b real 0m0.551s user 0m0.295s sys 0m0.072s diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -347,8 +347,7 @@ def author(repo, subset, x): # i18n: "author" is a keyword n = encoding.lower(getstring(x, _("author requires a string"))) kind, pattern, matcher = _substringmatcher(n) - return baseset([r for r in subset if - matcher(encoding.lower(repo[r].user()))]) + return lazyset(subset, lambda x: matcher(encoding.lower(repo[x].user()))) def bisect(repo, subset, x): """``bisect(string)``