[PATCH 1 of 2 STABLE] filemerge: introduce a 'regkeyalt' merge tool variable

Steve Borho steve at borho.org
Tue Mar 8 13:36:55 CST 2011

# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1299611118 21600
# Branch stable
# Node ID 5345edbefd8d264f3648f504ed41c2a1ee257cad
# Parent  42a34c0aeddc76262e1c7d4d22d00c72af4dbba6
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.

diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt
--- a/doc/hgrc.5.txt
+++ b/doc/hgrc.5.txt
@@ -556,6 +556,12 @@
   tool. Mercurial will search for this key first under
   ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
   Default: None
+  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
   Name of value to read from specified registry key. Defaults to the
   unnamed (default) value.
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -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"))

More information about the Mercurial-devel mailing list