Correct value in vcs.xml for directory attribute of mapping element

Answered

I have two IntelliJ 2018.1.3 Mercurial Java projects that both seem to work correctly, both in IntelliJ and in Mercurial.

Their vcs.xml files, however, differ in one minor way: One has:

<mapping directory="$PROJECT_DIR$" vcs="hg4idea" />

The other has:

<mapping directory="" vcs="hg4idea" />

Which value is (more) correct?

Full contents of the first vcs.xml:

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

Thanks.

0
4 comments
Avatar
Yaroslav Bedrov

Hello Ross,

Both are correct. Empty mapping is set by default (When "<Project>" is used in "Settingd | Version Control" mapping).

 

0

Hi Yaroslav,

Thanks for the info.

I'm changing my IDEA 2018.1.3 Ultimate project structure.  I'm not sure exactly what's best for me to use.

All of my IDEA projects / modules are .idea directory format.  They're all Gradle projects, with a top-level IDEA project in an hg repo.  I have two hg subrepos in the root of the top-level project, both of which contain an IDEA Gradle Java module.  Right now, the top-level project and the two modules each have an identical vcs.xml file with 

directory="$PROJECT_DIR$"

Should I remove the vcs.xml files from the two modules and change the top-level vcs.xml to include:

directory=""

Or should I leave things as they are?  Or do something else?

I will probably be adding more modules to the top-level project over time.

Thanks.

0

IDE uses one vcs.xml per project. So when your modules have their .ideafolderss with their own vcs.xml - it does not matter. You need to set mappings in the top-level one only.

Also note that with DVCS, such as Mercurial and Git, each VCS repo should be mapped in vcs.xml. So there should be 3 entries in the vcs.xml - one per each hg repo. I would also recommend stick to the explicit path, so keep the 

directory="$PROJECT_DIR$"

 

 

1

Thanks, Dmitriy. You saved me)

0

Please sign in to leave a comment.