comparison mercurial/cmdutil.py @ 25147:fb7b9a765bb9

walkchangerevs: replace try/except with 'next' Again, this make the code clearer.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 17 May 2015 18:11:02 -0700
parents 49c583ca48c4
children 4dfd4d3b9b93
comparison
equal deleted inserted replaced
25146:f542a2c89b60 25147:fb7b9a765bb9
1841 it = iter(revs) 1841 it = iter(revs)
1842 stopiteration = False 1842 stopiteration = False
1843 for windowsize in increasingwindows(): 1843 for windowsize in increasingwindows():
1844 nrevs = [] 1844 nrevs = []
1845 for i in xrange(windowsize): 1845 for i in xrange(windowsize):
1846 try: 1846 rev = next(it, None)
1847 rev = it.next() 1847 if rev is None:
1848 if want(rev):
1849 nrevs.append(rev)
1850 except (StopIteration):
1851 stopiteration = True 1848 stopiteration = True
1852 break 1849 break
1850 elif want(rev):
1851 nrevs.append(rev)
1853 for rev in sorted(nrevs): 1852 for rev in sorted(nrevs):
1854 fns = fncache.get(rev) 1853 fns = fncache.get(rev)
1855 ctx = change(rev) 1854 ctx = change(rev)
1856 if not fns: 1855 if not fns:
1857 def fns_generator(): 1856 def fns_generator():