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 @@ Supported arguments: 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. diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -25,8 +25,10 @@ def _toollist(ui, tool, part, default=[] 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"))