##// 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 def graft(
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 """Do a graft-like merge.
2601 """Do a graft-like merge.
2596
2602
@@ -2613,7 +2619,7 b' def graft('
2613 # to copy commits), and 2) informs update that the incoming changes are
2619 # to copy commits), and 2) informs update that the incoming changes are
2614 # newer than the destination so it doesn't prompt about "remote changed foo
2620 # newer than the destination so it doesn't prompt about "remote changed foo
2615 # which local deleted".
2621 # which local deleted".
2616 wctx = repo[None]
2622 wctx = wctx or repo[None]
2617 pctx = wctx.p1()
2623 pctx = wctx.p1()
2618 mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node())
2624 mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node())
2619
2625
@@ -2625,6 +2631,7 b' def graft('
2625 base.node(),
2631 base.node(),
2626 mergeancestor=mergeancestor,
2632 mergeancestor=mergeancestor,
2627 labels=labels,
2633 labels=labels,
2634 wc=wctx,
2628 )
2635 )
2629
2636
2630 if keepconflictparent and stats.unresolvedcount:
2637 if keepconflictparent and stats.unresolvedcount:
@@ -2639,6 +2646,11 b' def graft('
2639 if pother == pctx.node():
2646 if pother == pctx.node():
2640 pother = nullid
2647 pother = nullid
2641
2648
2649 if wctx.isinmemory():
2650 wctx.setparents(pctx.node(), pother)
2651 # fix up dirstate for copies and renames
2652 copies.graftcopies(wctx, ctx, base)
2653 else:
2642 with repo.dirstate.parentchange():
2654 with repo.dirstate.parentchange():
2643 repo.setparents(pctx.node(), pother)
2655 repo.setparents(pctx.node(), pother)
2644 repo.dirstate.write(repo.currenttransaction())
2656 repo.dirstate.write(repo.currenttransaction())
General Comments 0
You need to be logged in to leave comments. Login now