Patchwork [6,of,7,mergedriver] filemerge: don't attempt to premerge change/delete conflicts

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 19, 2015, 9:33 p.m.
Message ID <2bdd5467ac12506533d3.1447968838@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11538/
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 1447487760 28800
#      Fri Nov 13 23:56:00 2015 -0800
# Node ID 2bdd5467ac12506533d343f811efef690b88261c
# Parent  eee6801761dfd7f869d0d72a06e10a2621aec156
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 2bdd5467ac12
filemerge: don't attempt to premerge change/delete conflicts

This is mostly for completeness' sake -- at the moment we don't support any
tools for change/delete conflicts that would do a premerge.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -287,9 +287,9 @@  def _ifail(repo, mynode, orig, fcd, fco,
     used to resolve these conflicts."""
     return 1, False
 
-def _premerge(repo, toolconf, files, labels=None):
+def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
     tool, toolpath, binary, symlink = toolconf
-    if symlink:
+    if symlink or fcd.isabsent() or fco.isabsent():
         return 1
     a, b, c, back = files
 
@@ -610,7 +610,7 @@  def _filemerge(premerge, repo, mynode, o
             labels = _formatlabels(repo, fcd, fco, fca, labels)
 
         if premerge and mergetype == fullmerge:
-            r = _premerge(repo, toolconf, files, labels=labels)
+            r = _premerge(repo, fcd, fco, fca, toolconf, files, labels=labels)
             # complete if premerge successful (r is 0)
             return not r, r, False