diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -416,11 +416,15 @@ def manifestmerge(repo, wctx, p2, pa, br continue if n1 and n2: if f not in ma: - # Note: f as ancestor is wrong - we can't really make a 3-way - # merge without an ancestor file. - fa = copy.get(f, f) - actions['m'].append((f, (f, f, fa, False, pa.node()), - "both created")) + fa = copy.get(f, None) + if fa is not None: + actions['m'].append((f, (f, f, fa, False, pa.node()), + "both renamed from " + fa)) + else: + # Note: f as ancestor is wrong - we can't really make a + # 3-way merge without an ancestor file. + actions['m'].append((f, (f, f, f, False, pa.node()), + "both created")) else: a = ma[f] fla = ma.flags(f) diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t --- a/tests/test-rename-merge2.t +++ b/tests/test-rename-merge2.t @@ -343,7 +343,7 @@ args: ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493 preserving b for resolve of b preserving rev for resolve of rev - b: both created -> m + b: both renamed from a -> m updating: b 1/2 files (50.00%) picked tool 'python ../merge' for b (binary False symlink False) merging b