Patchwork [9,of,9,mergedriver] filemerge: run symlink check for :merge3

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

Comments

Siddharth Agarwal - Oct. 7, 2015, 7:33 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444202843 25200
#      Wed Oct 07 00:27:23 2015 -0700
# Node ID 6f20377d1295681760f98f3aeb585fe306eda3d3
# Parent  e6b2eba1061a1b48b7226cd8a26bca3f8646ba2a
filemerge: run symlink check for :merge3

Just like :merge, :merge3 doesn't support merging symlinks.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -279,7 +279,8 @@  def _imerge(repo, mynode, orig, fcd, fco
 
 @internaltool('merge3', True,
               _("merging %s incomplete! "
-                "(edit conflicts, then use 'hg resolve --mark')\n"))
+                "(edit conflicts, then use 'hg resolve --mark')\n"),
+              precheck=_symlinkcheck)
 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
     """
     Uses the internal non-interactive simple merge algorithm for merging
diff --git a/tests/test-merge-types.t b/tests/test-merge-types.t
--- a/tests/test-merge-types.t
+++ b/tests/test-merge-types.t
@@ -82,6 +82,29 @@  Symlink is other parent, executable is l
   a is an executable file with content:
   a
 
+  $ hg update -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg merge --debug --tool :merge3
+    searching for copies back to rev 1
+  resolving manifests
+   branchmerge: True, force: False, partial: False
+   ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
+   preserving a for resolve of a
+   a: versions differ -> m
+  picked tool ':merge3' for a (binary False symlink True)
+  merging a
+  my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
+  warning: internal :merge3 cannot merge symlinks for a
+  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+  $ tellmeabout a
+  a is an executable file with content:
+  a
+
 Update to link without local change should get us a symlink (issue3316):
 
   $ hg up -C 0