changeset 39554:ca9983c35d89

ancestor: rename local aliases of heapq functions in _lazyancestorsiter() The original names no longer look pretty. Just call them as heap*() instead.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 11 Sep 2018 22:36:51 +0900
parents bdb177923291
children 238a1480d7ad
files mercurial/ancestor.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ancestor.py	Mon Sep 10 21:58:59 2018 +0900
+++ b/mercurial/ancestor.py	Tue Sep 11 22:36:51 2018 +0900
@@ -262,8 +262,8 @@
 # Extracted from lazyancestors.__iter__ to avoid a reference cycle
 def _lazyancestorsiter(parentrevs, initrevs, stoprev, inclusive):
     seen = {nullrev}
-    schedule = heapq.heappush
-    nextitem = heapq.heappop
+    heappush = heapq.heappush
+    heappop = heapq.heappop
     see = seen.add
 
     if inclusive:
@@ -276,10 +276,10 @@
         for r in initrevs:
             p1, p2 = parentrevs(r)
             if p1 not in seen:
-                schedule(visit, -p1)
+                heappush(visit, -p1)
                 see(p1)
             if p2 not in seen:
-                schedule(visit, -p2)
+                heappush(visit, -p2)
                 see(p2)
 
     while visit:
@@ -294,13 +294,13 @@
             if current - p1 == 1:
                 visit[0] = -p1
             else:
-                nextitem(visit)
-                schedule(visit, -p1)
+                heappop(visit)
+                heappush(visit, -p1)
             see(p1)
         else:
-            nextitem(visit)
+            heappop(visit)
         if p2 not in seen:
-            schedule(visit, -p2)
+            heappush(visit, -p2)
             see(p2)
 
 class lazyancestors(object):