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