[PATCH 2 of 2] filemerge: switch the default name for internal tools from internal:x to :x

Mads Kiilerich mads at kiilerich.com
Sun Sep 28 10:15:35 CDT 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1411917328 -7200
#      Sun Sep 28 17:15:28 2014 +0200
# Node ID f04ebf1b4372d0f4e1b49c298f6d2b54123ee68d
# Parent  97948173c29b9daa4204c5de719073918a10dff7
filemerge: switch the default name for internal tools from internal:x to :x

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -25,10 +25,10 @@ internals = {}
 def internaltool(name, trymerge, onfailure=None):
     '''return a decorator for populating internal merge tool table'''
     def decorator(func):
-        fullname = 'internal:' + name
+        fullname = ':' + name
         func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip()
         internals[fullname] = func
-        internals[':' + name] = func
+        internals['internal:' + name] = func
         func.trymerge = trymerge
         func.onfailure = onfailure
         return func
@@ -112,8 +112,8 @@ def _picktool(repo, ui, path, binary, sy
 
     # internal merge or prompt as last resort
     if symlink or binary:
-        return "internal:prompt", None
-    return "internal:merge", None
+        return ":prompt", None
+    return ":merge", None
 
 def _eoltype(data):
     "Guess the EOL type of a file"
@@ -217,7 +217,7 @@ def _imerge(repo, mynode, orig, fcd, fco
     of merge."""
     tool, toolpath, binary, symlink = toolconf
     if symlink:
-        repo.ui.warn(_('warning: internal:merge cannot merge symlinks '
+        repo.ui.warn(_('warning: internal :merge cannot merge symlinks '
                        'for %s\n') % fcd.path())
         return False, 1
     r = _premerge(repo, toolconf, files, labels=labels)
@@ -247,7 +247,7 @@ def _imerge3(repo, mynode, orig, fcd, fc
 
 @internaltool('tagmerge', True,
               _("automatic tag merging of %s failed! "
-                "(use 'hg resolve --tool internal:merge' or another merge "
+                "(use 'hg resolve --tool :merge' or another merge "
                 "tool of your choice)\n"))
 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
     """
diff --git a/mercurial/help/merge-tools.txt b/mercurial/help/merge-tools.txt
--- a/mercurial/help/merge-tools.txt
+++ b/mercurial/help/merge-tools.txt
@@ -68,7 +68,7 @@ 6. If a program named ``hgmerge`` can be
    it will by default not be used for symlinks and binary files.
 
 7. If the file to be merged is not binary and is not a symlink, then
-   ``internal:merge`` is used.
+   internal ``:merge`` is used.
 
 8. The merge of the file fails and must be resolved before commit.
 
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
@@ -970,7 +970,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
+  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
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
@@ -40,7 +40,7 @@ Symlink is local parent, executable is o
   picked tool 'internal:merge' for a (binary False symlink True)
   merging a
   my a at 521a1e40188f+ other a at 3574f3e69b1c ancestor a at c334dc3be0da
-  warning: internal:merge cannot merge symlinks for a
+  warning: internal :merge 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
@@ -74,7 +74,7 @@ Symlink is other parent, executable is l
   picked tool 'internal:merge' for a (binary False symlink True)
   merging a
   my a at 3574f3e69b1c+ other a at 521a1e40188f ancestor a at c334dc3be0da
-  warning: internal:merge cannot merge symlinks for a
+  warning: internal :merge 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
@@ -106,7 +106,7 @@ Update to link with local change should 
    a: versions differ -> m
   updating: a 1/1 files (100.00%)
   (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
-  picked tool 'internal:prompt' for a (binary False symlink True)
+  picked tool ':prompt' for a (binary False symlink True)
    no tool found to merge a
   keep (l)ocal or take (o)ther? l
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -138,7 +138,7 @@ where that was what happened.
   $ hg ci -qm2
   $ hg merge
   merging f
-  warning: internal:merge cannot merge symlinks for 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
@@ -150,7 +150,7 @@ where that was what happened.
   $ hg up -Cqr1
   $ hg merge
   merging f
-  warning: internal:merge cannot merge symlinks for 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
@@ -177,7 +177,7 @@ Test removed 'x' flag merged with change
   $ hg ci -qm2
   $ hg merge
   merging f
-  warning: internal:merge cannot merge symlinks for 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
@@ -189,7 +189,7 @@ Test removed 'x' flag merged with change
   $ hg up -Cqr1
   $ hg merge
   merging f
-  warning: internal:merge cannot merge symlinks for 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
@@ -271,13 +271,13 @@ h: l vs l, different
   merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
   warning: cannot merge flags for c
   merging d
-  warning: internal:merge cannot merge symlinks for d
+  warning: internal :merge cannot merge symlinks for d
   merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
   merging f
-  warning: internal:merge cannot merge symlinks for f
+  warning: internal :merge cannot merge symlinks for f
   merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
   merging h
-  warning: internal:merge cannot merge symlinks for h
+  warning: internal :merge cannot merge symlinks for h
   merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
   3 files updated, 0 files merged, 0 files removed, 5 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
@@ -332,13 +332,13 @@ h: l vs l, different
   merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
   warning: cannot merge flags for c
   merging d
-  warning: internal:merge cannot merge symlinks for d
+  warning: internal :merge cannot merge symlinks for d
   merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
   merging f
-  warning: internal:merge cannot merge symlinks for f
+  warning: internal :merge cannot merge symlinks for f
   merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
   merging h
-  warning: internal:merge cannot merge symlinks for h
+  warning: internal :merge cannot merge symlinks for h
   merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
   3 files updated, 0 files merged, 0 files removed, 5 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
diff --git a/tests/test-tag.t b/tests/test-tag.t
--- a/tests/test-tag.t
+++ b/tests/test-tag.t
@@ -516,7 +516,7 @@ detect merge tag conflicts
   merging .hgtags
   automatic .hgtags merge failed
   the following 1 tags are in conflict: t7
-  automatic tag merging of .hgtags failed! (use 'hg resolve --tool internal:merge' or another merge tool of your choice)
+  automatic tag merging of .hgtags failed! (use 'hg resolve --tool :merge' or another merge tool of your choice)
   2 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]


More information about the Mercurial-devel mailing list