diff mercurial/cmdutil.py @ 24169:ac41aa4a66ab stable

amend: check for directory renames for both merge parents (issue4516) Before this change, amending a merge would lose the rename information for file adding in the second parents and implicitly renamed into a new directory. In case of the merge, we also look for directory rename data from the second parent. This seems to fix the bug and does not show other issues from the test suite.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 02 Mar 2015 19:01:00 +0000
parents 942a5a34b2d0
children 67952dc7a88f c780a63f61ca
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Mar 02 10:29:45 2015 -0600
+++ b/mercurial/cmdutil.py	Mon Mar 02 19:01:00 2015 +0000
@@ -2281,6 +2281,8 @@
                 date = ctx.date()
                 # Recompute copies (avoid recording a -> b -> a)
                 copied = copies.pathcopies(base, ctx)
+                if old.p2:
+                    copied.update(copies.pathcopies(old.p2(), ctx))
 
                 # Prune files which were reverted by the updates: if old
                 # introduced file X and our intermediate commit, node,