I'm using Windows 7 64bit, TortoiseHg version 2.6 (recently upgraded from an older version, maybe 2.2 something).
My USERPROFILE environment variable is set to the normal C:\users(my name), but when I add "ignore = ~.hgignore.ini" to the [ui] section of mercurial.ini, it doesn't actually look in my %USERPROFILE% directory for this file (I've also tried "ignore = %USERPROFILE%/.hgignore.ini" and many variations thereof). It completely ignores this file.
When I right click a file in TortoiseHg Workbench, and choose "ignore", the dialog box that pops up shows a dropdown of .hgignore files. One is the local one in the repository I'm looking at, and the other one that shows up is: <whatever I've set my HOME environment variable to>.hgignore eg. if HOME = 'C:\Temp", then "C:\Temp.hgignore" shows up in this dropdown (even if the actual file doesn't exist!). If I actually create this .hgignore file here, whatever patterns I put in that file are actually used & ignored by the repository.
Note: another oddity is that when I use the "~", the dropdown expands to whatever I've set my HOME environment variable to, and actually uses that file. When I use %USERPROFILE%, it literally shows "%USERPROFILE%.hgignore" in the dropdown (without expanding it - even though the env var exists), and doesn't use the .hgignore file at that location at all.
I've confirmed that changing my HOME environment variable changes this dropdown (but ONLY when the TortoiseHg Workbench is restarted).
Whether this is "by design" or not, it definitely should not use my HOME environment variable when I explicitly use the '%USERPROFILE% variable in my mercurial.ini file.