The decision on the discrepancy between the root of the project project Mercury and IntelliJ?

I have a mercury repository in which there are several projects (from IntelliJ IDEA) inside it. For example, I could:

foo/ projects/ project1/ .idea/ project2/ .idea/ 

I can push, pull, lock, etc. with command line and TortoiseHG. I have included Mercurial (hg4idea plugin) in IntelliJ, but almost nothing works. If I add the source code file, it will not be added, and for the files that I added manually, they do not show any changes. In IntelliJ, the Mercurial menu is turned on, but "add to VCS" is always grayed out. However, IntelliJ correctly lists the available change sets from the remote repository.

In the version control window for commands such as "hg status", I get errors such as:

 abort: repository C:/foo/projects/project1 not found! 

Commands like "hg incoming" seem to be doing well.

I suspect this may be due to the fact that the root of the project (project1) is below the root of the repository (foo). Does anyone know how to solve this problem? Can I change the configuration? If so, where is it in the settings?

I am using the latest (10.0.3) edition of IntelliJ IDEA Community.

+7
source share
2 answers

I managed to do it myself. When you turn on a project for Mercurial, IntelliJ sets the default project root as the mercury repository directory. Using this help page, I decided that this was what I needed to change.

  • Go to the Options dialog box (File Options)
  • Select Version Control
  • At the top level, it displays a list of directories and VCS, mine said "project root" and "Mercurial".
  • Click Delete to remove the existing mapping.
  • Click "Add" to add the mapping, and use the "..." button to select the mercurial root - "foo" in the above example.

This modifies the vcs.xml file in the .idea directory.

+13
source

The steps provided by Nick work for me in a similar setup with several projects living in the same Mercurial repository.

I was worried that IDEA would use absolute paths in vcs.xml, but it is more intelligent:

 <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="VcsDirectoryMappings"> <mapping directory="$PROJECT_DIR$/.." vcs="hg4idea" /> </component> </project> 
0
source

All Articles