Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 43816:32d11a23c9cf
graft: never set both parents equal in the dirstate (issue6098)
merge.graft() can set both parents equal in the dirstate when
keepparent=True. We don't seem to set that in core, but the evolve
extension does use it. So I couldn't figure out a way to add a test
for this patch in core.
Differential Revision: https://phab.mercurial-scm.org/D7549
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 05 Dec 2019 09:39:49 -0800 |
parents | fb07126dadbe |
children | a61287a95dc3 |
comparison
equal
deleted
inserted
replaced
43815:fb07126dadbe | 43816:32d11a23c9cf |
---|---|
2624 pother = nullid | 2624 pother = nullid |
2625 parents = ctx.parents() | 2625 parents = ctx.parents() |
2626 if keepparent and len(parents) == 2 and base in parents: | 2626 if keepparent and len(parents) == 2 and base in parents: |
2627 parents.remove(base) | 2627 parents.remove(base) |
2628 pother = parents[0].node() | 2628 pother = parents[0].node() |
2629 # Never set both parents equal to each other | |
2630 if pother == pctx.node(): | |
2631 pother = nullid | |
2629 | 2632 |
2630 with repo.dirstate.parentchange(): | 2633 with repo.dirstate.parentchange(): |
2631 repo.setparents(pctx.node(), pother) | 2634 repo.setparents(pctx.node(), pother) |
2632 repo.dirstate.write(repo.currenttransaction()) | 2635 repo.dirstate.write(repo.currenttransaction()) |
2633 # fix up dirstate for copies and renames | 2636 # fix up dirstate for copies and renames |