diff mercurial/filemerge.py @ 27038:58a4eb16e722

filemerge: add support for change/delete conflicts to the ':prompt' tool We haven't added the 'leave unresolved' option yet -- that will come in a future patch.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 13 Nov 2015 23:52:26 -0800
parents a8908c139f2f
children d7517deedf86
line wrap: on
line diff
--- a/mercurial/filemerge.py	Wed Nov 18 15:41:50 2015 -0800
+++ b/mercurial/filemerge.py	Fri Nov 13 23:52:26 2015 -0800
@@ -221,10 +221,23 @@
     fd = fcd.path()
 
     try:
-        index = ui.promptchoice(_("no tool found to merge %s\n"
-                                  "keep (l)ocal or take (o)ther?"
-                                  "$$ &Local $$ &Other") % fd, 0)
-        choice = ['local', 'other'][index]
+        if fco.isabsent():
+            index = ui.promptchoice(
+                _("local changed %s which remote deleted\n"
+                  "use (c)hanged version or (d)elete?"
+                  "$$ &Changed $$ &Delete") % fd, 0)
+            choice = ['local', 'other'][index]
+        elif fcd.isabsent():
+            index = ui.promptchoice(
+                _("remote changed %s which local deleted\n"
+                  "use (c)hanged version or leave (d)eleted?"
+                  "$$ &Changed $$ &Deleted") % fd, 0)
+            choice = ['other', 'local'][index]
+        else:
+            index = ui.promptchoice(_("no tool found to merge %s\n"
+                                      "keep (l)ocal or take (o)ther?"
+                                      "$$ &Local $$ &Other") % fd, 0)
+            choice = ['local', 'other'][index]
 
         if choice == 'other':
             return _iother(repo, mynode, orig, fcd, fco, fca, toolconf)