Wednesday, October 17, 2007

How to Install Mercurial Support in NetBeans

Getting NetBeans to grok Mercurial is pretty simple when you know all the gotchas. I already got stuck on the installation twice so I decided to turn this into a blog entry, so that I know what to do when I see the problem again. :)

To install Mercurial support in NetBeans, do the following:
  1. Get Mercurial and install it. On Mac you can install it via MacPorts
  2. Get NetBeans 6 and install it
  3. Install the Mercurial plugin via Tools->Plugins->Available Plugins->Mercurial
  4. Restart the IDE
  5. If Versioning->Mercurials in the menu bar is disabled, go to Tools->Options->Miscelanious->Mercurial (on Mac NetBeans->Preferences->Miscelanious->Mercurial) and verify that Mercurial executable path is set up correctly - in my case, since I installed Mercurial via MacPorts, the path should be /opt/local/bin
  6. Restart the IDE

The problem, I encountered already twice, is that if the Mercurial executable path is not set up properly, the Versioning->Mercurials menu item is disabled and NetBeans doesn't give you any hint as to what went wrong. For some reason the path on my Mac is by default pointing to my python directory, which is not correct. Once the path is corrected and the IDE is restarted, everything works as expected.

No comments: