##// END OF EJS Templates
dagop: bulk rename variables in revancestors() generator...
Yuya Nishihara -
r32999:08e2793d default
parent child Browse files
Show More
@@ -31,30 +31,30 b' def _genrevancestors(repo, revs, followf'
31 # without fully computing the input revs
31 # without fully computing the input revs
32 revs.sort(reverse=True)
32 revs.sort(reverse=True)
33 irevs = iter(revs)
33 irevs = iter(revs)
34 h = []
34 pendingheap = []
35
35
36 inputrev = next(irevs, None)
36 inputrev = next(irevs, None)
37 if inputrev is not None:
37 if inputrev is not None:
38 heapq.heappush(h, -inputrev)
38 heapq.heappush(pendingheap, -inputrev)
39
39
40 seen = set()
40 seen = set()
41 while h:
41 while pendingheap:
42 current = -heapq.heappop(h)
42 currev = -heapq.heappop(pendingheap)
43 if current == inputrev:
43 if currev == inputrev:
44 inputrev = next(irevs, None)
44 inputrev = next(irevs, None)
45 if inputrev is not None:
45 if inputrev is not None:
46 heapq.heappush(h, -inputrev)
46 heapq.heappush(pendingheap, -inputrev)
47 if current not in seen:
47 if currev not in seen:
48 seen.add(current)
48 seen.add(currev)
49 yield current
49 yield currev
50 try:
50 try:
51 for parent in cl.parentrevs(current)[:cut]:
51 for prev in cl.parentrevs(currev)[:cut]:
52 if parent != node.nullrev:
52 if prev != node.nullrev:
53 heapq.heappush(h, -parent)
53 heapq.heappush(pendingheap, -prev)
54 except error.WdirUnsupported:
54 except error.WdirUnsupported:
55 for parent in repo[current].parents()[:cut]:
55 for pctx in repo[currev].parents()[:cut]:
56 if parent.rev() != node.nullrev:
56 if pctx.rev() != node.nullrev:
57 heapq.heappush(h, -parent.rev())
57 heapq.heappush(pendingheap, -pctx.rev())
58
58
59 def revancestors(repo, revs, followfirst):
59 def revancestors(repo, revs, followfirst):
60 """Like revlog.ancestors(), but supports followfirst."""
60 """Like revlog.ancestors(), but supports followfirst."""
General Comments 0
You need to be logged in to leave comments. Login now