Patchwork [8,of,9,mergedriver] filemerge: print correct name of tool for symlink checks

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

Comments

Siddharth Agarwal - Oct. 7, 2015, 7:33 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444202684 25200
#      Wed Oct 07 00:24:44 2015 -0700
# Node ID e6b2eba1061a1b48b7226cd8a26bca3f8646ba2a
# Parent  5dfec1bacba6783bfd9114a2fc5f22ef6d713d50
filemerge: print correct name of tool for symlink checks

Earlier we'd print ':merge' even if the tool was something else like ':union'.
That's clearly a bug.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -231,8 +231,8 @@  def _premerge(repo, toolconf, files, lab
 def _symlinkcheck(repo, mynode, orig, fcd, fco, fca, toolconf):
     tool, toolpath, binary, symlink = toolconf
     if symlink:
-        repo.ui.warn(_('warning: internal :merge cannot merge symlinks '
-                       'for %s\n') % fcd.path())
+        repo.ui.warn(_('warning: internal %s cannot merge symlinks '
+                       'for %s\n') % (tool, fcd.path()))
         return False
     return True
 
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
@@ -62,17 +62,17 @@  Symlink is other parent, executable is l
   $ hg update -C 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ hg merge --debug
+  $ hg merge --debug --tool :union
     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 ':merge' for a (binary False symlink True)
+  picked tool ':union' for a (binary False symlink True)
   merging a
   my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
-  warning: internal :merge cannot merge symlinks for a
+  warning: internal :union 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