Created project from sources under Mercurial but no changes shown or commit possible
I'm trialling IDEA as an alternative to Netbeans and have created a project from existing sources. One module in this project is maintained under Mercurial. The project builds ok, but when I select the Mercurial/Commit directory in the drop-down menu on the module, it tells me there is "Nothing to commit - no changes detected". On the command line I can use hg status and see there are numerous changes. I can also use Mercurial/Show history in IDEA and see the correct log for the repository.
I have another module in the same project maintained with Git, and it is behaving as expected.
Any suggestions on how to make this work?
请先登录再写评论。
Hi Clyde,
What's your IJ version, OS and hg version?
Could you provide a sample project and hg repo to check at local environment?
Denis
I think I figured it out. The module root directory was not the root of the Mercurial repository. The layout was something like this:
~/projects <- contains .hg/ folder
~/projects/modulex <- top of module
I have rearranged my Mercurial repositories so that the module root and repository root are the same, and now when I create a project in IJ it detects the repository and everything seems to be working.
Netbeans seemed to cope with the other layout, though I'm not 100% certain of that since I have just switched from svn to hg, so I'm still climbing the hg learning curve.
The project/module structure of IJ is also foreign to me - how do I manage a library module that is used in more than one project? Can a module belong to multiple projects? And where are a project's properties stored?
Basically, when you have a 'library module' and want all clients to use the most up-to-date version, you should add that 'library module' to the target client's project and configure it as a module dependency.
All settings are divided to 'ide settings' and 'project settings'. Project-level settings are contained at the project's '.idea' directory and ide-level settings are stored at IJ config home.
Denis
But again what if I need to manage the library module for more than one project?
____________
agile methodology
When you want to modify library's source code and get all clients use the most up-to-date version all the time, you need to add that library module to every project which uses it.
Alternatively you can publish compiled version to, say, local maven/gradle repo and reference it at client projects from there.
Denis