Patchwork [01,of,14] merge: warn when internal:merge cannot merge symlinks

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 13, 2013, 7:02 p.m.
Message ID <8946e9d56444bd7b6661.1358103756@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/576/
State Superseded
Commit 26627c30735a610f59979a36885b327b25d8dbff
Headers show

Comments

Mads Kiilerich - Jan. 13, 2013, 7:02 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1358102416 -3600
# Node ID 8946e9d56444bd7b666151dda753562c756b3ab0
# Parent  948f495fb2302a6241787a2d5924ef328f2f4967
merge: warn when internal:merge cannot merge symlinks

A follow-up to d084df89d948.

internal:merge should never be picked for merging symlinks ... but in the test
suite we have HGMERGE="internal:merge" which bypasses all the usual merge-tool
cleverness. Without any output it can be hard to figure out what happened and
where the problem is.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -208,6 +208,8 @@  def _imerge(repo, mynode, orig, fcd, fco
     the partially merged file."""
     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)
diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -843,6 +843,7 @@  internal merge cannot handle symlinks an
   $ hg commit -qm 'f is symlink'
   $ hg merge -r 2 --tool internal:merge
   merging f
+  warning: internal:merge cannot merge symlinks for f
   merging f 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