_makelogrevset: replace try/except with 'next' usage

More readable without the 'except StopIteration' abomination.
This commit is contained in:
Pierre-Yves David 2015-05-18 12:17:08 -05:00
parent b06100dbed
commit f794990267

View File

@ -1933,10 +1933,7 @@ def _makelogrevset(repo, pats, opts, revs):
# --follow with FILE behaviour depends on revs... # --follow with FILE behaviour depends on revs...
it = iter(revs) it = iter(revs)
startrev = it.next() startrev = it.next()
try: followdescendants = startrev < next(it, startrev)
followdescendants = startrev < it.next()
except (StopIteration):
followdescendants = False
# branch and only_branch are really aliases and must be handled at # branch and only_branch are really aliases and must be handled at
# the same time # the same time