_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...
it = iter(revs)
startrev = it.next()
try:
followdescendants = startrev < it.next()
except (StopIteration):
followdescendants = False
followdescendants = startrev < next(it, startrev)
# branch and only_branch are really aliases and must be handled at
# the same time