mercurial/revset.py
changeset 24938 6db8074f9150
parent 24937 f5518b47cdd1
child 24939 85544a52ee84
--- a/mercurial/revset.py	Wed Mar 26 16:14:30 2014 -0700
+++ b/mercurial/revset.py	Wed May 06 11:29:09 2015 -0700
@@ -25,20 +25,20 @@
     cl = repo.changelog
 
     def iterate():
-        revqueue, inputrev = None, None
-        h = []
-
         revs.sort(reverse=True)
         revqueue = util.deque(revs)
-        if revqueue:
-            inputrev = revqueue.popleft()
-            heapq.heappush(h, -inputrev)
+        if not revqueue:
+            return
+
+        h = []
+        inputrev = revqueue.popleft()
+        heapq.heappush(h, -inputrev)
 
         seen = set()
         while h:
             current = -heapq.heappop(h)
             if current not in seen:
-                if inputrev and current == inputrev:
+                if current == inputrev:
                     if revqueue:
                         inputrev = revqueue.popleft()
                         heapq.heappush(h, -inputrev)