Patchwork [5,of,7,mergedriver] filemerge._mergecheck: add check for change/delete conflicts

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 19, 2015, 9:33 p.m.
Message ID <eee6801761dfd7f869d0.1447968837@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11537/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Siddharth Agarwal - Nov. 19, 2015, 9:33 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1447487885 28800
#      Fri Nov 13 23:58:05 2015 -0800
# Node ID eee6801761dfd7f869d0d72a06e10a2621aec156
# Parent  6100ebf277120db2ea3efb7fb7e7deb0c2585a60
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r eee6801761df
filemerge._mergecheck: add check for change/delete conflicts

Merge tools that perform an actual 3-way merge can't handle change/delete
conflicts. This adds a check for that.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -328,6 +328,10 @@  def _mergecheck(repo, mynode, orig, fcd,
         repo.ui.warn(_('warning: internal %s cannot merge symlinks '
                        'for %s\n') % (tool, fcd.path()))
         return False
+    if fcd.isabsent() or fco.isabsent():
+        repo.ui.warn(_('warning: internal %s cannot merge change/delete '
+                       'conflict for %s\n') % (tool, fcd.path()))
+        return False
     return True
 
 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):