diff mercurial/merge.py @ 23475:67f1d68861fb

merge: don't ignore conflicting file in remote renamed directory When the remote side has renamed a directory from a/ to b/ and added a file b/c in it, and the local side has added a file a/c, we end up moving a/c to b/c without considering the remote version of b/c. Add a check for this case and use the merge ('m') action in this case instead of the directory rename ('dm') action.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 Dec 2014 10:56:07 -0800
parents 9f4ac44a7273
children 39a12719ec65
line wrap: on
line diff
--- a/mercurial/merge.py	Sun Nov 23 15:08:50 2014 -0800
+++ b/mercurial/merge.py	Wed Dec 03 10:56:07 2014 -0800
@@ -446,8 +446,12 @@
                 pass # we'll deal with it on m2 side
             elif f in movewithdir: # directory rename, move local
                 f2 = movewithdir[f]
-                actions['dm'].append((f2, (f, fl1),
-                                "remote directory rename - move from " + f))
+                if f2 in m2:
+                    actions['m'].append((f2, (f, f2, None, True, pa.node()),
+                                   "remote directory rename, both created"))
+                else:
+                    actions['dm'].append((f2, (f, fl1),
+                                  "remote directory rename - move from " + f))
             elif f in copy:
                 f2 = copy[f]
                 actions['m'].append((f, (f, f2, f2, False, pa.node()),