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.

Bug 146089 - Cannot use hg.cmd
Summary: Cannot use hg.cmd
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on:
Blocks: 163689
  Show dependency tree
 
Reported: 2008-09-03 19:49 UTC by Jesse Glick
Modified: 2009-04-30 07:32 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-09-03 19:49:19 UTC
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.)
Comment 1 Jesse Glick 2008-09-06 16:02:56 UTC
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.
Comment 2 Jesse Glick 2008-09-06 16:04:41 UTC
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.
Comment 3 Tomas Stupka 2008-09-08 10:46:57 UTC
> ...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.

Comment 4 Jesse Glick 2008-09-10 03:57:57 UTC
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.)
Comment 5 Tomas Stupka 2008-09-10 11:12:55 UTC
nb already runs hgk.cmd, so this shouldn't be an issue here
Comment 6 Marian Petras 2009-04-29 14:38:21 UTC
Done.

Changeset id:
c8150b1512e2
Comment 7 Quality Engineering 2009-04-30 07:32:24 UTC
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)