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 |
curre |
|
42 | currev = -heapq.heappop(pendingheap) | |
43 |
if curre |
|
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 curre |
|
47 | if currev not in seen: | |
48 |
seen.add(curre |
|
48 | seen.add(currev) | |
49 |
yield curre |
|
49 | yield currev | |
50 | try: |
|
50 | try: | |
51 |
for p |
|
51 | for prev in cl.parentrevs(currev)[:cut]: | |
52 |
if p |
|
52 | if prev != node.nullrev: | |
53 |
heapq.heappush(h, -p |
|
53 | heapq.heappush(pendingheap, -prev) | |
54 | except error.WdirUnsupported: |
|
54 | except error.WdirUnsupported: | |
55 |
for p |
|
55 | for pctx in repo[currev].parents()[:cut]: | |
56 |
if p |
|
56 | if pctx.rev() != node.nullrev: | |
57 |
heapq.heappush(h, -p |
|
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