# HG changeset patch # User Matt Mackall # Date 2009-06-08 23:14:44 # Node ID 60fa3371aa75fb8c4ca1070fdcf3398f5c845e5d # Parent f8be48c6b08ccba517295140c2828a36fab92462 merge: pretend ancestor is local to simplify backwards and overwrite diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -133,6 +133,10 @@ def manifestmerge(repo, p1, p2, pa, over m2 = p2.manifest() ma = pa.manifest() backwards = (pa == p2) + + if backwards or overwrite: + ma = m1 + action = [] copy, copied, diverge = {}, {}, {} @@ -209,7 +213,7 @@ def manifestmerge(repo, p1, p2, pa, over else: # case 4,21 A/B/B act("local moved to " + f2, "m", f, f2, f, fmerge(f, f2, f2), False) - elif f in ma: + elif f in ma and not n[20:]: if n != ma[f] and not overwrite: if repo.ui.prompt( _(" local changed %s which remote deleted\n" 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 @@ -38,7 +38,7 @@ summary: 2 resolving manifests overwrite False partial False ancestor 33aaa84a386b local 802f095af299+ remote 33aaa84a386b - b: remote deleted -> r + b: other deleted -> r removing b 0 files updated, 0 files merged, 1 files removed, 0 files unresolved changeset: 0:33aaa84a386b 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 @@ -43,8 +43,8 @@ side2 resolving manifests overwrite True partial False ancestor 537353581d3d local ded32b0db104+ remote 221226fb2bd8 - side2: remote deleted -> r - side1: remote deleted -> r + side2: other deleted -> r + side1: other deleted -> r main: remote created -> g removing side1 removing side2