I have being working with Mercurial with IDEA on Linux for the last few weeks and thought it would make the basis of a useful article.
Setting up Mercurial
IDEA includes a plugin (hg4idea) to access Mercurial so the first thing is to ensure this is setup and enabled. There is also a Mercurial settings section but I did not need to alter anything here. The plugin uses Mercurial so make sure this is installed on your machine.
When I started committing from IDEA, I found that the commits appeared under the username test@local rather than my username from other operations (this is slightly annoying as Eclipse picks this information up automatically).
The solution is to add the details to your Mercurial configuration file. You can either edit the global version (which is $HOME/.hgrc) or edit it for each project (in which case there is a hidden directory .hg in your IDEA project containing the file hgrc). This may already contain some details – I added the following lines to my copy. There is good documentation on this at the Mercurial site.
[ui] username = mark stephens <email@example.com>
Setting up a project in IDEA
IDEA has a specific option Checkout from version control to setup a new project from Version control which allows you to import and setup a project. It is straight-foward to use and means that IDEA is setup correctly. It is less fiddly than creating a new project in Mercurial with Eclipse.
I did try manually cloning the Mercurial project from the command-line and do not recommend this.
The update project option is very slick and performs all the background operations you need in Mercurial – I run it at the start of every session. Commit allows you to compare changes and commit them – you just need to remember to push the changes as well!
Lastly, there is a littile display in the status bar which tells you which branch and revision you are on.
I have found that Mercurial works very well in IDEA. It is fast and well-integrated. And if you get stuck, the IDEA developers are pretty helpful on anwsering any questions posted. Do you have any tips for using it with IDEA?
Did you know...
IDRsolutions offers a whole range of online file converters to convert PDF and Microsoft Excel, Word and Office Documents to HTML5, SVG or image formats?
It is free to use for single file conversions and also includes Developer links if you want to use our commercial software for bulk conversions. Find out more on this page