changeset 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 bbfae32f178e
files mercurial/merge.py tests/test-issue619.t tests/test-newbranch.t tests/test-push-warn.t
diffstat 4 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Sat Mar 05 16:34:59 2011 -0600
+++ b/mercurial/merge.py	Mon Mar 07 15:03:10 2011 -0600
@@ -540,7 +540,7 @@
         action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
 
         ### apply phase
-        if not branchmerge or fastforward: # just jump to the new rev
+        if not branchmerge: # just jump to the new rev
             fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
         if not partial:
             repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
@@ -549,7 +549,7 @@
 
         if not partial:
             repo.dirstate.setparents(fp1, fp2)
-            recordupdates(repo, action, branchmerge and not fastforward)
+            recordupdates(repo, action, branchmerge)
             if not branchmerge and not fastforward:
                 repo.dirstate.setbranch(p2.branch())
     finally:
--- a/tests/test-issue619.t	Sat Mar 05 16:34:59 2011 -0600
+++ b/tests/test-issue619.t	Mon Mar 07 15:03:10 2011 -0600
@@ -19,12 +19,7 @@
   $ hg merge b
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
-  $ hg branch
-  default
-  $ hg parent --template '{rev}:{node|short} {branches}: {desc}\n'
-  1:06c2121185be b: b
   $ hg ci -Ammerge
-  created new head
 
 Bogus fast-forward should fail:
 
--- a/tests/test-newbranch.t	Sat Mar 05 16:34:59 2011 -0600
+++ b/tests/test-newbranch.t	Mon Mar 07 15:03:10 2011 -0600
@@ -209,11 +209,12 @@
   $ hg branch
   foo
   $ hg commit -m'Merge ff into foo'
-  created new head
   $ hg parents
-  changeset:   6:6af8030670c9
+  changeset:   6:917eb54e1b4b
   branch:      foo
   tag:         tip
+  parent:      4:98d14f698afe
+  parent:      5:6683a60370cb
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     Merge ff into foo
--- a/tests/test-push-warn.t	Sat Mar 05 16:34:59 2011 -0600
+++ b/tests/test-push-warn.t	Mon Mar 07 15:03:10 2011 -0600
@@ -413,7 +413,6 @@
   (branch merge, don't forget to commit)
 
   $ hg -R k ci -m merge
-  created new head
 
   $ hg -R k push -r a j
   pushing to j