Show More
@@ -2582,7 +2582,7 b' def update(' | |||
|
2582 | 2582 | |
|
2583 | 2583 | |
|
2584 | 2584 | def graft( |
|
2585 |
repo, ctx, |
|
|
2585 | repo, ctx, base, labels=None, keepparent=False, keepconflictparent=False | |
|
2586 | 2586 | ): |
|
2587 | 2587 | """Do a graft-like merge. |
|
2588 | 2588 | |
@@ -2593,7 +2593,7 b' def graft(' | |||
|
2593 | 2593 | renames/copies appropriately. |
|
2594 | 2594 | |
|
2595 | 2595 | ctx - changeset to rebase |
|
2596 |
|
|
|
2596 | base - merge base, usually ctx.p1() | |
|
2597 | 2597 | labels - merge labels eg ['local', 'graft'] |
|
2598 | 2598 | keepparent - keep second parent if any |
|
2599 | 2599 | keepconflictparent - if unresolved, keep parent used for the merge |
@@ -2612,7 +2612,7 b' def graft(' | |||
|
2612 | 2612 | ctx.node(), |
|
2613 | 2613 | True, |
|
2614 | 2614 | True, |
|
2615 |
|
|
|
2615 | base.node(), | |
|
2616 | 2616 | mergeancestor=mergeancestor, |
|
2617 | 2617 | labels=labels, |
|
2618 | 2618 | ) |
@@ -2622,15 +2622,15 b' def graft(' | |||
|
2622 | 2622 | else: |
|
2623 | 2623 | pother = nullid |
|
2624 | 2624 | parents = ctx.parents() |
|
2625 |
if keepparent and len(parents) == 2 and |
|
|
2626 |
parents.remove( |
|
|
2625 | if keepparent and len(parents) == 2 and base in parents: | |
|
2626 | parents.remove(base) | |
|
2627 | 2627 | pother = parents[0].node() |
|
2628 | 2628 | |
|
2629 | 2629 | with repo.dirstate.parentchange(): |
|
2630 | 2630 | repo.setparents(repo[b'.'].node(), pother) |
|
2631 | 2631 | repo.dirstate.write(repo.currenttransaction()) |
|
2632 | 2632 | # fix up dirstate for copies and renames |
|
2633 |
copies.duplicatecopies(repo, repo[None], ctx.rev(), |
|
|
2633 | copies.duplicatecopies(repo, repo[None], ctx.rev(), base.rev()) | |
|
2634 | 2634 | return stats |
|
2635 | 2635 | |
|
2636 | 2636 |
General Comments 0
You need to be logged in to leave comments.
Login now