changeset 27037:a8908c139f2f

filemerge: add support for change/delete conflicts to the ':other' merge tool This, along with the previous patch to the :local merge tool, covers the full matrix of change/delete conflicts.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 18 Nov 2015 15:41:50 -0800
parents 63d6bc874dea
children 58a4eb16e722
files mercurial/filemerge.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Wed Nov 18 15:40:28 2015 -0800
+++ b/mercurial/filemerge.py	Wed Nov 18 15:41:50 2015 -0800
@@ -242,8 +242,14 @@
 @internaltool('other', nomerge)
 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf):
     """Uses the other version of files as the merged version."""
-    repo.wwrite(fcd.path(), fco.data(), fco.flags())
-    return 0, False
+    if fco.isabsent():
+        # local changed, remote deleted -- 'deleted' picked
+        repo.wvfs.unlinkpath(fcd.path())
+        deleted = True
+    else:
+        repo.wwrite(fcd.path(), fco.data(), fco.flags())
+        deleted = False
+    return 0, deleted
 
 @internaltool('fail', nomerge)
 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf):