mercurial/cmdutil.py
changeset 25272 6c76c42a5893
parent 25271 1b1eaf1885df
child 25273 8e0e334bad42
equal deleted inserted replaced
25271:1b1eaf1885df 25272:6c76c42a5893
  1753     follow = opts.get('follow') or opts.get('follow_first')
  1753     follow = opts.get('follow') or opts.get('follow_first')
  1754     revs = _logrevs(repo, opts)
  1754     revs = _logrevs(repo, opts)
  1755     if not revs:
  1755     if not revs:
  1756         return []
  1756         return []
  1757     wanted = set()
  1757     wanted = set()
  1758     slowpath = match.anypats() or (match.files() and opts.get('removed'))
  1758     slowpath = match.anypats() or ((match.isexact() or match.prefix()) and
       
  1759                                    opts.get('removed'))
  1759     fncache = {}
  1760     fncache = {}
  1760     change = repo.changectx
  1761     change = repo.changectx
  1761 
  1762 
  1762     # First step is to fill wanted, the set of revisions that we want to yield.
  1763     # First step is to fill wanted, the set of revisions that we want to yield.
  1763     # When it does not induce extra cost, we also fill fncache for revisions in
  1764     # When it does not induce extra cost, we also fill fncache for revisions in
  1833                 wanted = wanted - [x]
  1834                 wanted = wanted - [x]
  1834 
  1835 
  1835     # Now that wanted is correctly initialized, we can iterate over the
  1836     # Now that wanted is correctly initialized, we can iterate over the
  1836     # revision range, yielding only revisions in wanted.
  1837     # revision range, yielding only revisions in wanted.
  1837     def iterate():
  1838     def iterate():
  1838         if follow and not match.files():
  1839         if follow and match.always():
  1839             ff = _followfilter(repo, onlyfirst=opts.get('follow_first'))
  1840             ff = _followfilter(repo, onlyfirst=opts.get('follow_first'))
  1840             def want(rev):
  1841             def want(rev):
  1841                 return ff.match(rev) and rev in wanted
  1842                 return ff.match(rev) and rev in wanted
  1842         else:
  1843         else:
  1843             def want(rev):
  1844             def want(rev):