Mercurial > hg
changeset 25168:4dfd4d3b9b93
_makelogrevset: replace try/except with 'next' usage
More readable without the 'except StopIteration' abomination.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 18 May 2015 12:17:08 -0500 |
parents | 6f7048cc2419 |
children | 7855d1f5f152 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 1 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat May 16 15:46:54 2015 -0700 +++ b/mercurial/cmdutil.py Mon May 18 12:17:08 2015 -0500 @@ -1933,10 +1933,7 @@ # --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