Show More
@@ -449,12 +449,18 b' class subsetparentswalker(object):' | |||
|
449 | 449 | # - one of the parents is not active, |
|
450 | 450 | # - or descendants' parents are unresolved. |
|
451 | 451 | if not bothparentsactive or unresolved or resolved: |
|
452 |
if len(parentrevs) |
|
|
452 | if len(parentrevs) <= 1: | |
|
453 | # can avoid copying the tracking pointer | |
|
454 | parentpointers = [(unresolved, resolved)] | |
|
455 | else: | |
|
456 | parentpointers = [ | |
|
457 | (unresolved, resolved), | |
|
458 | (unresolved.copy(), resolved.copy()), | |
|
459 | ] | |
|
453 | 460 | # 'rev' is a merge revision. increment the pending count |
|
454 | 461 | # as the 'unresolved' dict will be duplicated. |
|
455 | 462 | for r in unresolved: |
|
456 | 463 | pendingcnt[r] += 1 |
|
457 | reusable = True # can we avoid copying the tracking pointer? | |
|
458 | 464 | for i, p in enumerate(parentrevs): |
|
459 | 465 | assert p < rev |
|
460 | 466 | heapq.heappush(tovisit, -p) |
@@ -462,6 +468,7 b' class subsetparentswalker(object):' | |||
|
462 | 468 | # 'p' is a fork revision. concatenate tracking pointers |
|
463 | 469 | # and decrement the pending count accordingly. |
|
464 | 470 | knownunresolved, knownresolved = pointers[p] |
|
471 | unresolved, resolved = parentpointers[i] | |
|
465 | 472 | for r, c in unresolved.items(): |
|
466 | 473 | c += [b'1', b'2'][i] |
|
467 | 474 | if r in knownunresolved: |
@@ -475,11 +482,8 b' class subsetparentswalker(object):' | |||
|
475 | 482 | # simply propagate the 'resolved' set as deduplicating |
|
476 | 483 | # 'unresolved' here would be slightly complicated. |
|
477 | 484 | knownresolved.update(resolved) |
|
478 | elif reusable: | |
|
479 | pointers[p] = (unresolved, resolved) | |
|
480 | reusable = False | |
|
481 | 485 | else: |
|
482 |
pointers[p] = |
|
|
486 | pointers[p] = parentpointers[i] | |
|
483 | 487 | |
|
484 | 488 | # then, populate the active parents directly and add the current |
|
485 | 489 | # 'rev' to the tracking pointers of the inactive parents. |
General Comments 0
You need to be logged in to leave comments.
Login now