Mercurial > hg
comparison mercurial/merge.py @ 13550:1792b8a9422b stable
merge: back out single-parent fast-forward merge
This backs out
changeset: 13158:9e7e24052745
user: Mads Kiilerich <mads@kiilerich.com>
date: Tue Dec 07 03:29:21 2010 +0100
summary: merge: fast-forward merge with descendant
Before named branches, the invariants were:
a) "merges" always have two parents
b) p1 is not linearly related to p2
Adding named branches made (b) problematic, so the above patch was
introduced, which fixed (b) but broke (a).
After discussion, we decided that the invariants should be:
a) "merges" always have two parents
b) p1 is not linearly related to p2 OR p1 and p2 are on different branches
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 07 Mar 2011 15:03:10 -0600 |
parents | 6217040b2780 |
children | 0ab0ceefddf2 5b3383ea67d2 |
comparison
equal
deleted
inserted
replaced
13549:6217040b2780 | 13550:1792b8a9422b |
---|---|
538 _checkcollision(p2) | 538 _checkcollision(p2) |
539 action += _forgetremoved(wc, p2, branchmerge) | 539 action += _forgetremoved(wc, p2, branchmerge) |
540 action += manifestmerge(repo, wc, p2, pa, overwrite, partial) | 540 action += manifestmerge(repo, wc, p2, pa, overwrite, partial) |
541 | 541 |
542 ### apply phase | 542 ### apply phase |
543 if not branchmerge or fastforward: # just jump to the new rev | 543 if not branchmerge: # just jump to the new rev |
544 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, '' | 544 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, '' |
545 if not partial: | 545 if not partial: |
546 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) | 546 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) |
547 | 547 |
548 stats = applyupdates(repo, action, wc, p2, pa, overwrite) | 548 stats = applyupdates(repo, action, wc, p2, pa, overwrite) |
549 | 549 |
550 if not partial: | 550 if not partial: |
551 repo.dirstate.setparents(fp1, fp2) | 551 repo.dirstate.setparents(fp1, fp2) |
552 recordupdates(repo, action, branchmerge and not fastforward) | 552 recordupdates(repo, action, branchmerge) |
553 if not branchmerge and not fastforward: | 553 if not branchmerge and not fastforward: |
554 repo.dirstate.setbranch(p2.branch()) | 554 repo.dirstate.setbranch(p2.branch()) |
555 finally: | 555 finally: |
556 wlock.release() | 556 wlock.release() |
557 | 557 |