Commits

Andrew Godwin committed 9f110a0

Fix new branch calculator

Comments (0)

Files changed (1)

heechee/repo/hg.py

         while int(changectx) + 1 > revision:
             # Add the parents of the current thing onto the queue
             for new_changectx in changectx.parents():
-                heapq.heappush((int(new_changectx), new_changectx))
+                heapq.heappush(queue, (int(new_changectx), new_changectx))
             # Get the next changectx
             try:
-                revno, changectx = queue.popleft()
+                revno, changectx = heapq.heappop(queue)
             except:
                 raise NoBranchError("Cannot find matching changeset for branch '%s'." % branch)
         return changectx
     
-    
     def _tree_for_branch(self, branch, revision, name, parent):
         """
         Returns the file tree for the given branch at the given revision.