1182 ctx - changeset to rebase |
1182 ctx - changeset to rebase |
1183 pctx - merge base, usually ctx.p1() |
1183 pctx - merge base, usually ctx.p1() |
1184 labels - merge labels eg ['local', 'graft'] |
1184 labels - merge labels eg ['local', 'graft'] |
1185 |
1185 |
1186 """ |
1186 """ |
|
1187 # If we're grafting a descendant onto an ancestor, be sure to pass |
|
1188 # mergeancestor=True to update. This does two things: 1) allows the merge if |
|
1189 # the destination is the same as the parent of the ctx (so we can use graft |
|
1190 # to copy commits), and 2) informs update that the incoming changes are |
|
1191 # newer than the destination so it doesn't prompt about "remote changed foo |
|
1192 # which local deleted". |
|
1193 mergeancestor = repo.changelog.isancestor(repo['.'].node(), ctx.node()) |
1187 |
1194 |
1188 stats = update(repo, ctx.node(), True, True, False, pctx.node(), |
1195 stats = update(repo, ctx.node(), True, True, False, pctx.node(), |
1189 labels=labels) |
1196 mergeancestor=mergeancestor, labels=labels) |
|
1197 |
1190 # drop the second merge parent |
1198 # drop the second merge parent |
1191 repo.dirstate.beginparentchange() |
1199 repo.dirstate.beginparentchange() |
1192 repo.setparents(repo['.'].node(), nullid) |
1200 repo.setparents(repo['.'].node(), nullid) |
1193 repo.dirstate.write() |
1201 repo.dirstate.write() |
1194 # fix up dirstate for copies and renames |
1202 # fix up dirstate for copies and renames |