the ebuild started installing an env.d entry that sets HG a while back: https://sources.gentoo.org/dev-util/mercurial/mercurial-1.0.1-r1.ebuild?r1=1.1&r2=1.2 the reason was: Install env.d file containing HG variable needed for hgk. imo, hgk should be fixed to falling back to finding `hg` via $PATH. otherwise, we stuff this variable into the environment of pretty much every process out there. the hg python code already does this: mercurial/util.py: def hgexecutable(): """return location of the 'hg' executable. Defaults to $HG or 'hg' in the search path. """
I've added a mercurial-3.8.1-r1 that no longer installs the env.d file. From inspecting the Mercurial source code, it seems that HG is now always set when invoking hgk, at least when it is invoked through the hgk extension (the hg view command).