Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 44089:bd22e90c54b3
graft: extract repo[None] to a variable
I plan to allow the caller pass in an overlayworkingctx, so this
prepares for that.
Differential Revision: https://phab.mercurial-scm.org/D7857
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 27 Dec 2019 13:03:40 -0800 |
parents | a61287a95dc3 |
children | 2f0a44c69e07 |
comparison
equal
deleted
inserted
replaced
44088:b3ec1ea95ee6 | 44089:bd22e90c54b3 |
---|---|
2603 # mergeancestor=True to update. This does two things: 1) allows the merge if | 2603 # mergeancestor=True to update. This does two things: 1) allows the merge if |
2604 # the destination is the same as the parent of the ctx (so we can use graft | 2604 # the destination is the same as the parent of the ctx (so we can use graft |
2605 # to copy commits), and 2) informs update that the incoming changes are | 2605 # to copy commits), and 2) informs update that the incoming changes are |
2606 # newer than the destination so it doesn't prompt about "remote changed foo | 2606 # newer than the destination so it doesn't prompt about "remote changed foo |
2607 # which local deleted". | 2607 # which local deleted". |
2608 pctx = repo[b'.'] | 2608 wctx = repo[None] |
2609 pctx = wctx.p1() | |
2609 mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node()) | 2610 mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node()) |
2610 | 2611 |
2611 stats = update( | 2612 stats = update( |
2612 repo, | 2613 repo, |
2613 ctx.node(), | 2614 ctx.node(), |
2632 | 2633 |
2633 with repo.dirstate.parentchange(): | 2634 with repo.dirstate.parentchange(): |
2634 repo.setparents(pctx.node(), pother) | 2635 repo.setparents(pctx.node(), pother) |
2635 repo.dirstate.write(repo.currenttransaction()) | 2636 repo.dirstate.write(repo.currenttransaction()) |
2636 # fix up dirstate for copies and renames | 2637 # fix up dirstate for copies and renames |
2637 copies.duplicatecopies(repo, repo[None], ctx.rev(), base.rev()) | 2638 copies.duplicatecopies(repo, wctx, ctx.rev(), base.rev()) |
2638 return stats | 2639 return stats |
2639 | 2640 |
2640 | 2641 |
2641 def purge( | 2642 def purge( |
2642 repo, | 2643 repo, |