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