Using Mecurial command line with IDEA projects


I am new to IDEA and have managed to setup a new project using Lua and Mercurial. I have a couple of questions.

Is it advisable or not to VC the .idea directory or the .iml file of my project. What are the pros and cons of doing so?

Second I configured some files to exclude using the VCS excludes in the project configuration, however, these excludes are not recognized by the hg commmand line. How do I have the excludes enabled for both IDEA and the hg command line.


I am using IDEA 12 on MacOS 10.7.5


Comment actions Permalink

Ok I put in a .hgignore file in my project root and IDEA recognized this and started ignoring these files also.

When I specifiy files to ignore in the IDEA VCS settings where is this information recoreded?

My question as to using VC on the IDEA files still stands. Is this a good or bad thing to do and why?

tks, louie

Comment actions Permalink

Hello Louis.

Basically you should exclude from VCS just the .idea/workspace.xml file (or .iws configuration file if you use file-based format for the project) which stores you personal settings (placement and positions of your windows etc). Please refer to for details.

I.e. .iml file should be shared. Also note if the project is built using Maven, it won't be necesary to share .iml file because it will be created after buid automatically. For this to work the only thing you need to ensure is that if you use some global libraries or application servers so they use the same name e.g. "7.0" for JDK or "Tomcat 7.0" for Apache Tomcat server etc.


Please sign in to leave a comment.