author | Pierre-Yves David <pierre-yves.david@fb.com> |
Sun, 17 May 2015 17:54:58 -0700 | |
changeset 25143 | 91c49621b2b8 |
parent 25142 | 24140873ca4c |
child 25144 | 81a395447b34 |
--- a/mercurial/revset.py Sun May 17 17:47:42 2015 -0700 +++ b/mercurial/revset.py Sun May 17 17:54:58 2015 -0700 @@ -28,21 +28,18 @@ revs.sort(reverse=True) irevs = iter(revs) h = [] - try: - inputrev = irevs.next() + + inputrev = next(irevs, None) + if inputrev is not None: heapq.heappush(h, -inputrev) - except StopIteration: - return seen = set() while h: current = -heapq.heappop(h) if current == inputrev: - try: - inputrev = irevs.next() + inputrev = next(irevs, None) + if inputrev is not None: heapq.heappush(h, -inputrev) - except StopIteration: - pass if current not in seen: seen.add(current) yield current