diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -221,12 +221,11 @@ def update(repo, node, branchmerge=False backwards = (pa == p2) # is there a linear path from p1 to p2? - linear = (pa == p1 or pa == p2) - if branchmerge and linear: - raise util.Abort(_("there is nothing to merge, just use " - "'hg update' or look at 'hg heads'")) - - if not linear and not (overwrite or branchmerge): + if pa == p1 or pa == p2: + if branchmerge: + raise util.Abort(_("there is nothing to merge, just use " + "'hg update' or look at 'hg heads'")) + elif not (overwrite or branchmerge): raise util.Abort(_("update spans branches, use 'hg merge' " "or 'hg update -C' to lose changes")) @@ -243,8 +242,8 @@ def update(repo, node, branchmerge=False # resolve the manifest to determine which files # we care about merging repo.ui.note(_("resolving manifests\n")) - repo.ui.debug(_(" overwrite %s branchmerge %s partial %s linear %s\n") % - (overwrite, branchmerge, bool(partial), linear)) + repo.ui.debug(_(" overwrite %s branchmerge %s partial %s\n") % + (overwrite, branchmerge, bool(partial))) repo.ui.debug(_(" ancestor %s local %s remote %s\n") % (short(p1), short(p2), short(pa))) @@ -253,14 +252,14 @@ def update(repo, node, branchmerge=False if not force: checkunknown(repo, m2, status) - if linear: + if not branchmerge: action += forgetremoved(m2, status) action += manifestmerge(repo.ui, m1, m2, ma, overwrite, backwards, partial) del m1, m2, ma ### apply phase - if linear or overwrite: + if not branchmerge: # we don't need to do any magic, just jump to the new rev p1, p2 = p2, nullid diff --git a/tests/test-merge7.out b/tests/test-merge7.out --- a/tests/test-merge7.out +++ b/tests/test-merge7.out @@ -22,7 +22,7 @@ added 1 changesets with 1 changes to 1 f (run 'hg heads' to see heads, 'hg merge' to merge) merge: warning: conflicts during merge resolving manifests - overwrite None branchmerge True partial False linear False + overwrite None branchmerge True partial False ancestor 451c744aabcc local a070d41e8360 remote faaea63e63a9 test.txt versions differ, resolve merging test.txt diff --git a/tests/test-up-local-change.out b/tests/test-up-local-change.out --- a/tests/test-up-local-change.out +++ b/tests/test-up-local-change.out @@ -15,7 +15,7 @@ date: Mon Jan 12 13:46:40 1970 +0 summary: 1 resolving manifests - overwrite False branchmerge False partial False linear True + overwrite False branchmerge False partial False ancestor 33aaa84a386b local 802f095af299 remote 33aaa84a386b a versions differ, resolve remote created b @@ -31,7 +31,7 @@ date: Mon Jan 12 13:46:40 1970 +0 summary: 2 resolving manifests - overwrite False branchmerge False partial False linear True + overwrite False branchmerge False partial False ancestor 802f095af299 local 33aaa84a386b remote 33aaa84a386b remote deleted b removing b @@ -49,7 +49,7 @@ date: Mon Jan 12 13:46:40 1970 +0 summary: 1 resolving manifests - overwrite False branchmerge False partial False linear True + overwrite False branchmerge False partial False ancestor 33aaa84a386b local 802f095af299 remote 33aaa84a386b a versions differ, resolve remote created b @@ -100,7 +100,7 @@ failed abort: outstanding uncommitted changes failed resolving manifests - overwrite False branchmerge True partial False linear False + overwrite False branchmerge True partial False ancestor 802f095af299 local 030602aee63d remote 33aaa84a386b a versions differ, resolve b versions differ, resolve diff --git a/tests/test-update-reverse.out b/tests/test-update-reverse.out --- a/tests/test-update-reverse.out +++ b/tests/test-update-reverse.out @@ -40,7 +40,7 @@ a side1 side2 resolving manifests - overwrite True branchmerge False partial False linear False + overwrite True branchmerge False partial False ancestor ded32b0db104 local 221226fb2bd8 remote 537353581d3d remote deleted side2, clobbering remote deleted side1, clobbering