comparison mercurial/revset.py @ 13908:ba669bc7f851

revset: replace for-loop with list comprehension
author Idan Kamara <idankk86@gmail.com>
date Thu, 07 Apr 2011 16:20:40 +0300
parents a8d13ee0ce68
children 27573f2ddfb9
comparison
equal deleted inserted replaced
13907:a0ed0d0dd713 13908:ba669bc7f851
696 """ 696 """
697 state = getstring(x, _("bisect requires a string")).lower() 697 state = getstring(x, _("bisect requires a string")).lower()
698 if state not in ('good', 'bad', 'skip', 'unknown'): 698 if state not in ('good', 'bad', 'skip', 'unknown'):
699 raise ParseError(_('invalid bisect state')) 699 raise ParseError(_('invalid bisect state'))
700 marked = set(repo.changelog.rev(n) for n in hbisect.load_state(repo)[state]) 700 marked = set(repo.changelog.rev(n) for n in hbisect.load_state(repo)[state])
701 l = [] 701 return [r for r in subset if r in marked]
702 for r in subset:
703 if r in marked:
704 l.append(r)
705 return l
706 702
707 symbols = { 703 symbols = {
708 "adds": adds, 704 "adds": adds,
709 "all": getall, 705 "all": getall,
710 "ancestor": ancestor, 706 "ancestor": ancestor,