Mercurial > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
23474:9f4ac44a7273 | 23475:67f1d68861fb |
---|---|
444 elif n1: # file exists only on local side | 444 elif n1: # file exists only on local side |
445 if f in copied: | 445 if f in copied: |
446 pass # we'll deal with it on m2 side | 446 pass # we'll deal with it on m2 side |
447 elif f in movewithdir: # directory rename, move local | 447 elif f in movewithdir: # directory rename, move local |
448 f2 = movewithdir[f] | 448 f2 = movewithdir[f] |
449 actions['dm'].append((f2, (f, fl1), | 449 if f2 in m2: |
450 "remote directory rename - move from " + f)) | 450 actions['m'].append((f2, (f, f2, None, True, pa.node()), |
451 "remote directory rename, both created")) | |
452 else: | |
453 actions['dm'].append((f2, (f, fl1), | |
454 "remote directory rename - move from " + f)) | |
451 elif f in copy: | 455 elif f in copy: |
452 f2 = copy[f] | 456 f2 = copy[f] |
453 actions['m'].append((f, (f, f2, f2, False, pa.node()), | 457 actions['m'].append((f, (f, f2, f2, False, pa.node()), |
454 "local copied/moved from " + f2)) | 458 "local copied/moved from " + f2)) |
455 elif f in ma: # clean, a different, no remote | 459 elif f in ma: # clean, a different, no remote |