walkchangerevs: replace try/except with 'next'
Again, this make the code clearer.
--- a/mercurial/cmdutil.py Sun May 17 18:06:09 2015 -0700
+++ b/mercurial/cmdutil.py Sun May 17 18:11:02 2015 -0700
@@ -1843,13 +1843,12 @@
for windowsize in increasingwindows():
nrevs = []
for i in xrange(windowsize):
- try:
- rev = it.next()
- if want(rev):
- nrevs.append(rev)
- except (StopIteration):
+ rev = next(it, None)
+ if rev is None:
stopiteration = True
break
+ elif want(rev):
+ nrevs.append(rev)
for rev in sorted(nrevs):
fns = fncache.get(rev)
ctx = change(rev)