comparison mercurial/cmdutil.py @ 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 fb7b9a765bb9
children 7855d1f5f152
comparison
equal deleted inserted replaced
25167:6f7048cc2419 25168:4dfd4d3b9b93
1931 else: 1931 else:
1932 followfirst = 0 1932 followfirst = 0
1933 # --follow with FILE behaviour depends on revs... 1933 # --follow with FILE behaviour depends on revs...
1934 it = iter(revs) 1934 it = iter(revs)
1935 startrev = it.next() 1935 startrev = it.next()
1936 try: 1936 followdescendants = startrev < next(it, startrev)
1937 followdescendants = startrev < it.next()
1938 except (StopIteration):
1939 followdescendants = False
1940 1937
1941 # branch and only_branch are really aliases and must be handled at 1938 # branch and only_branch are really aliases and must be handled at
1942 # the same time 1939 # the same time
1943 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', []) 1940 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
1944 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']] 1941 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]