Show More
@@ -274,20 +274,26 b' def _lazyancestorsiter(parentrevs, initr' | |||
|
274 | 274 | visit = [] |
|
275 | 275 | heapq.heapify(visit) |
|
276 | 276 | for r in initrevs: |
|
277 |
|
|
|
278 |
|
|
|
279 |
|
|
|
280 |
|
|
|
277 | p1, p2 = parentrevs(r) | |
|
278 | if p1 not in seen: | |
|
279 | schedule(visit, -p1) | |
|
280 | see(p1) | |
|
281 | if p2 not in seen: | |
|
282 | schedule(visit, -p2) | |
|
283 | see(p2) | |
|
281 | 284 | |
|
282 | 285 | while visit: |
|
283 | 286 | current = -nextitem(visit) |
|
284 | 287 | if current < stoprev: |
|
285 | 288 | break |
|
286 | 289 | yield current |
|
287 |
|
|
|
288 |
|
|
|
289 |
|
|
|
290 |
|
|
|
290 | p1, p2 = parentrevs(current) | |
|
291 | if p1 not in seen: | |
|
292 | schedule(visit, -p1) | |
|
293 | see(p1) | |
|
294 | if p2 not in seen: | |
|
295 | schedule(visit, -p2) | |
|
296 | see(p2) | |
|
291 | 297 | |
|
292 | 298 | class lazyancestors(object): |
|
293 | 299 | def __init__(self, pfunc, revs, stoprev=0, inclusive=False): |
@@ -178,9 +178,9 b' def test_missingancestors(seed, rng):' | |||
|
178 | 178 | # | |
|
179 | 179 | # o 0 |
|
180 | 180 | |
|
181 |
graph = {0: [-1], 1: [0], 2: [1], 3: [1], 4: [2 |
|
|
182 | 7: [4], 8: [-1], 9: [6, 7], 10: [5], 11: [3, 7], 12: [9], | |
|
183 | 13: [8]} | |
|
181 | graph = {0: [-1, -1], 1: [0, -1], 2: [1, -1], 3: [1, -1], 4: [2, -1], | |
|
182 | 5: [4, -1], 6: [4, -1], 7: [4, -1], 8: [-1, -1], 9: [6, 7], | |
|
183 | 10: [5, -1], 11: [3, 7], 12: [9, -1], 13: [8, -1]} | |
|
184 | 184 | |
|
185 | 185 | def genlazyancestors(revs, stoprev=0, inclusive=False): |
|
186 | 186 | print(("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" % |
General Comments 0
You need to be logged in to leave comments.
Login now