hg.exe doesn't appear to be a valid hg executable

Dear forum,

I've just installed TortoiseHG 2.9.2 (which comes with Mercurial 2.7.2) and PyCharm 3.0.1 on Windows 8 Professional. TortoiseHG works fine, and I can run "hg version" from a cmd.exe prompt:

C:\Users\Sybren>hg version Mercurial Distributed SCM (version 2.7.2) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2013 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

However, PyCharm claims that "hg.exe doesn't appear to be a valid hg executable". Even when I configure it to use an explicit path (C:\Program Files\TortoiseHg\hg.exe) it refuses to use the executable. I've tried:

  • the default "hg.exe"
  • C:\Program Files\TortoiseHg\hg.exe
  • C:/Program Files/TortoiseHg/hg.exe
  • C:\Progra~1\TortoiseHg\hg.exe

All to no avail. Could it perhaps have something to do with PyCharm being 32-bit and TortoiseHG 64-bit? From other forum posts I reckoned that it would just use the CLI interface, so in that case the different bit-ness shouldn't matter.

Thanks for any help,
See a related issue from the issue tracker. Maybe it's a regression.
I hope it can be fixed soon ;-)
Can confirm that HG integration is broken in IDEA 12.1.5 build #IU-129.1328.
I've added comment to http://youtrack.jetbrains.com/issue/IDEA-110986, but not sure it will be noticed, as issue has an "Obsolete" state.
This seems to be partially fixed in 3.0.2. I still get this error when my mercurial.ini contains:

[color] mode=win32

This causes the following warning when hg.exe is NOT run in a console window:

warning: failed to set color mode to win32

Removing the option makes PyCharm accept my hg.exe. However, I do need that option in order to get colours in a Cygwin window. Since it's only a warning, I don't think it's fair that PyCharm outright refuses to accept my hg.exe as a valid Mercurial executable.

Please sign in to leave a comment.