This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have an XP installation in which I have added hg.cmd to my %Path%, so that running 'hg version' etc. from command.exe works fine. (I use hg.cmd so I can build Hg from sources under Cygwin: './setup.py build -c mingw32' where hg.cmd runs 'python ....\scripts-2.5\hg') But NetBeans is not able to find the Mercurial command, even if I specify the containing directory in the Options dialog. I should be able to have hg.cmd somewhere, and NB should use 'cmd /c hg.cmd ...' to run it. (See org.netbeans.nbbuild.HgExec for ideas.)
I consider it a DEFECT (perhaps not P3) that running "hg" from a command shell works fine, yet NetBeans fails to do the same, and does not even offer any kind of explanation. I only knew that the issue is *.cmd vs. *.exe because I happened to be fixing a similar bug in nbbuild recently.
Note that there is also no good workaround: you can install a prebuilt public release of Hg, or go through the very complex set of steps required to build hg.exe from sources.
> ...you can install a prebuilt public release of Hg well, this is, i guess, how it was supposed to work and usually also works. Otherwise i would consider it a defect either. anyway, nb explicitly checks for hg.exe. Even, if i'm not quite sure why, it looks like the fix shouldn't be a big deal. Will fix asap.
You cannot Runtime.exec a *.bat or *.cmd directly; you have to 'cmd /c' it. (Similar to a Unix shell script with the execute bit off.)
nb already runs hgk.cmd, so this shouldn't be an issue here
Done. Changeset id: c8150b1512e2
Integrated into 'main-golden', will be available in build *200904300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c8150b1512e2 User: Marian Petras <mpetras@netbeans.org> Log: implemented enhancement #146089 - Mercurial launchers "hg.bat" and "hg.cmd" are now accepted (when running on Windows)