Patchwork [6,of,9,mergedriver] filemerge: use symlinkcheck for :merge and :union

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 7, 2015, 7:33 a.m.
Message ID <42a1ea6e37c54d88b31f.1444203221@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10851/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 7, 2015, 7:33 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444197441 25200
#      Tue Oct 06 22:57:21 2015 -0700
# Node ID 42a1ea6e37c54d88b31f28e35e9cab3f0d0ee7ab
# Parent  fe7e0a3d986f45a4d9f65ad4e85618dd1fc1264f
filemerge: use symlinkcheck for :merge and :union

This exposes a couple of bugs, both of which will be fixed in upcoming patches.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -242,11 +242,6 @@  def _merge(repo, mynode, orig, fcd, fco,
     files. It will fail if there are any conflicts and leave markers in
     the partially merged file. Markers will have two sections, one for each side
     of merge, unless mode equals 'union' which suppresses the markers."""
-    tool, toolpath, binary, symlink = toolconf
-    if symlink:
-        repo.ui.warn(_('warning: internal :merge cannot merge symlinks '
-                       'for %s\n') % fcd.path())
-        return False, 1
     r = _premerge(repo, toolconf, files, labels=labels)
     if r:
         a, b, c, back = files
@@ -259,7 +254,8 @@  def _merge(repo, mynode, orig, fcd, fco,
 
 @internaltool('union', True,
               _("merging %s incomplete! "
-                "(edit conflicts, then use 'hg resolve --mark')\n"))
+                "(edit conflicts, then use 'hg resolve --mark')\n"),
+              precheck=_symlinkcheck)
 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
     """
     Uses the internal non-interactive simple merge algorithm for merging
@@ -270,7 +266,8 @@  def _iunion(repo, mynode, orig, fcd, fco
 
 @internaltool('merge', True,
               _("merging %s incomplete! "
-                "(edit conflicts, then use 'hg resolve --mark')\n"))
+                "(edit conflicts, then use 'hg resolve --mark')\n"),
+              precheck=_symlinkcheck)
 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
     """
     Uses the internal non-interactive simple merge algorithm for merging