changeset 13565:984175605311 stable

filemerge: introduce a 'regkeyalt' merge tool variable This allows us to provide alternate search keys for 64bit operating systems that may have 32bit merge tools installed. Presumably it may find other uses.
author Steve Borho <steve@borho.org>
date Tue, 08 Mar 2011 13:05:18 -0600
parents 391948925b67
children a87a0fcb412f
files doc/hgrc.5.txt mercurial/filemerge.py
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/hgrc.5.txt	Tue Mar 08 10:03:01 2011 -0600
+++ b/doc/hgrc.5.txt	Tue Mar 08 13:05:18 2011 -0600
@@ -556,6 +556,12 @@
   tool. Mercurial will search for this key first under
   ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
   Default: None
+``regkeyalt``
+  An alternate Windows registry key to try if the first key is not
+  found.  The alternate key uses the same ``regname`` and ``regappend``
+  semantics of the primary key.  The most common use for this key
+  is to search for 32bit applications on 64bit operating systems.
+  Default: None
 ``regname``
   Name of value to read from specified registry key. Defaults to the
   unnamed (default) value.
--- a/mercurial/filemerge.py	Tue Mar 08 10:03:01 2011 -0600
+++ b/mercurial/filemerge.py	Tue Mar 08 13:05:18 2011 -0600
@@ -25,8 +25,10 @@
 def _findtool(ui, tool):
     if tool in _internal:
         return tool
-    k = _toolstr(ui, tool, "regkey")
-    if k:
+    for kn in ("regkey", "regkeyalt"):
+        k = _toolstr(ui, tool, kn)
+        if not k:
+            continue
         p = util.lookup_reg(k, _toolstr(ui, tool, "regname"))
         if p:
             p = util.find_exe(p + _toolstr(ui, tool, "regappend"))