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