Mercurial > hg
comparison mercurial/cmdutil.py @ 17675:8575f4a2126e
clfilter: remove usage of `range` in favor of iteration over changelog
If we want to apply filtering at changelog level, we need to iterate over it.
See previous changeset description for details.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Thu, 20 Sep 2012 19:01:53 +0200 |
parents | 63e45aee46d4 |
children | f87683a1b02a |
comparison
equal
deleted
inserted
replaced
17674:e69274f8d444 | 17675:8575f4a2126e |
---|---|
1392 revs = scmutil.revrange(repo, opts['rev']) | 1392 revs = scmutil.revrange(repo, opts['rev']) |
1393 else: | 1393 else: |
1394 if follow and len(repo) > 0: | 1394 if follow and len(repo) > 0: |
1395 revs = scmutil.revrange(repo, ['.:0']) | 1395 revs = scmutil.revrange(repo, ['.:0']) |
1396 else: | 1396 else: |
1397 revs = range(len(repo) - 1, -1, -1) | 1397 revs = list(repo.changelog) |
1398 revs.reverse() | |
1398 if not revs: | 1399 if not revs: |
1399 return iter([]), None, None | 1400 return iter([]), None, None |
1400 expr, filematcher = _makegraphlogrevset(repo, pats, opts, revs) | 1401 expr, filematcher = _makegraphlogrevset(repo, pats, opts, revs) |
1401 if expr: | 1402 if expr: |
1402 matcher = revset.match(repo.ui, expr) | 1403 matcher = revset.match(repo.ui, expr) |