##// END OF EJS Templates
graft: let caller pass in overlayworkingctx to merge.graft()...
Martin von Zweigbergk -
r44692:fc7175df default
parent child Browse files
Show More
@@ -2590,7 +2590,13 b' def update('
2590 2590
2591 2591
2592 2592 def graft(
2593 repo, ctx, base, labels=None, keepparent=False, keepconflictparent=False
2593 repo,
2594 ctx,
2595 base,
2596 labels=None,
2597 keepparent=False,
2598 keepconflictparent=False,
2599 wctx=None,
2594 2600 ):
2595 2601 """Do a graft-like merge.
2596 2602
@@ -2613,7 +2619,7 b' def graft('
2613 2619 # to copy commits), and 2) informs update that the incoming changes are
2614 2620 # newer than the destination so it doesn't prompt about "remote changed foo
2615 2621 # which local deleted".
2616 wctx = repo[None]
2622 wctx = wctx or repo[None]
2617 2623 pctx = wctx.p1()
2618 2624 mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node())
2619 2625
@@ -2625,6 +2631,7 b' def graft('
2625 2631 base.node(),
2626 2632 mergeancestor=mergeancestor,
2627 2633 labels=labels,
2634 wc=wctx,
2628 2635 )
2629 2636
2630 2637 if keepconflictparent and stats.unresolvedcount:
@@ -2639,11 +2646,16 b' def graft('
2639 2646 if pother == pctx.node():
2640 2647 pother = nullid
2641 2648
2642 with repo.dirstate.parentchange():
2643 repo.setparents(pctx.node(), pother)
2644 repo.dirstate.write(repo.currenttransaction())
2649 if wctx.isinmemory():
2650 wctx.setparents(pctx.node(), pother)
2645 2651 # fix up dirstate for copies and renames
2646 2652 copies.graftcopies(wctx, ctx, base)
2653 else:
2654 with repo.dirstate.parentchange():
2655 repo.setparents(pctx.node(), pother)
2656 repo.dirstate.write(repo.currenttransaction())
2657 # fix up dirstate for copies and renames
2658 copies.graftcopies(wctx, ctx, base)
2647 2659 return stats
2648 2660
2649 2661
General Comments 0
You need to be logged in to leave comments. Login now