comparison mercurial/revset.py @ 20448:92f6f2db3cf4

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
author Lucas Moscovicz <lmoscovicz@fb.com>
date Wed, 29 Jan 2014 09:22:31 -0800
parents abb91b74f758
children ad2f1512eaa6
comparison
equal deleted inserted replaced
20447:abb91b74f758 20448:92f6f2db3cf4
345 Alias for ``user(string)``. 345 Alias for ``user(string)``.
346 """ 346 """
347 # i18n: "author" is a keyword 347 # i18n: "author" is a keyword
348 n = encoding.lower(getstring(x, _("author requires a string"))) 348 n = encoding.lower(getstring(x, _("author requires a string")))
349 kind, pattern, matcher = _substringmatcher(n) 349 kind, pattern, matcher = _substringmatcher(n)
350 return baseset([r for r in subset if 350 return lazyset(subset, lambda x: matcher(encoding.lower(repo[x].user())))
351 matcher(encoding.lower(repo[r].user()))])
352 351
353 def bisect(repo, subset, x): 352 def bisect(repo, subset, x):
354 """``bisect(string)`` 353 """``bisect(string)``
355 Changesets marked in the specified bisect status: 354 Changesets marked in the specified bisect status:
356 355