Patchwork [1,of,2] filemerge: introduce :x as short version of internal:x merge tool name

login
register
mail settings
Submitter Mads Kiilerich
Date Sept. 28, 2014, 3:15 p.m.
Message ID <97948173c29b9daa4204.1411917334@localhost.localdomain>
Download mbox | patch
Permalink /patch/6012/
State Accepted
Headers show

Comments

Mads Kiilerich - Sept. 28, 2014, 3:15 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1411917325 -7200
#      Sun Sep 28 17:15:25 2014 +0200
# Node ID 97948173c29b9daa4204c5de719073918a10dff7
# Parent  4a502fab58617b3c84210fe053b7393b8d2247a5
filemerge: introduce :x as short version of internal:x merge tool name

"internal:" is so much typing - it is frequently specified on the command line
and gives options that are longer than any other I have seen.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -28,6 +28,7 @@  def internaltool(name, trymerge, onfailu
         fullname = 'internal:' + name
         func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip()
         internals[fullname] = func
+        internals[':' + name] = func
         func.trymerge = trymerge
         func.onfailure = onfailure
         return func
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
@@ -425,7 +425,7 @@  ui.merge specifies internal:fail:
   # hg stat
   M f
 
-ui.merge specifies internal:local:
+ui.merge specifies :local (without internal prefix):
 
   $ beforemerge
   [merge-tools]
@@ -433,7 +433,7 @@  ui.merge specifies internal:local:
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  $ hg merge -r 2 --config ui.merge=internal:local
+  $ hg merge -r 2 --config ui.merge=:local
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ aftermerge