Show More
@@ -309,26 +309,25 b' class lazyancestors(object):' | |||
|
309 | 309 | revision number order. That order is also topological: a child is |
|
310 | 310 | always emitted before its parent. |
|
311 | 311 | |
|
312 | If inclusive is True, yield all the revs first (ignoring stoprev), | |
|
313 | then yield all the ancestors of revs as when inclusive is False. If an | |
|
314 | element in revs is an ancestor of a different rev it is not yielded | |
|
315 | again.""" | |
|
312 | If inclusive is True, the source revisions are also yielded. The | |
|
313 | reverse revision number order is still enforced.""" | |
|
316 | 314 | seen = set() |
|
317 | 315 | revs = self._initrevs |
|
318 | if self._inclusive: | |
|
319 | for rev in revs: | |
|
320 | yield rev | |
|
321 | seen.update(revs) | |
|
322 | 316 | |
|
323 | 317 | parentrevs = self._parentrevs |
|
324 | 318 | stoprev = self._stoprev |
|
325 | visit = [] | |
|
326 | heapq.heapify(visit) | |
|
327 | 319 | schedule = heapq.heappush |
|
328 | 320 | nextitem = heapq.heappop |
|
329 | 321 | see = seen.add |
|
330 | 322 | see(nullrev) |
|
331 | 323 | |
|
324 | if self._inclusive: | |
|
325 | visit = [-r for r in revs] | |
|
326 | seen.update(revs) | |
|
327 | heapq.heapify(visit) | |
|
328 | else: | |
|
329 | visit = [] | |
|
330 | heapq.heapify(visit) | |
|
332 | 331 | for r in revs: |
|
333 | 332 | for parent in parentrevs(r): |
|
334 | 333 | if parent not in seen: |
@@ -9,10 +9,10 b' membership: [1, 0]' | |||
|
9 | 9 | iteration: [1, 0] |
|
10 | 10 | % lazy ancestor set for [11, 13], stoprev = 0, inclusive = True |
|
11 | 11 | membership: [11, 13, 7, 8, 3, 4, 1, 0] |
|
12 |
iteration: [1 |
|
|
12 | iteration: [13, 11, 8, 7, 4, 3, 2, 1, 0] | |
|
13 | 13 | % lazy ancestor set for [11, 13], stoprev = 6, inclusive = False |
|
14 | 14 | membership: [7, 8] |
|
15 | 15 | iteration: [8, 7] |
|
16 | 16 | % lazy ancestor set for [11, 13], stoprev = 6, inclusive = True |
|
17 | 17 | membership: [11, 13, 7, 8] |
|
18 |
iteration: [1 |
|
|
18 | iteration: [13, 11, 8, 7] |
General Comments 0
You need to be logged in to leave comments.
Login now