0

Say I have a project like this in Mercurial

root/
  proj1
  proj2

If I open proj1 in IntelliJ, I will have to set the VCS root to "root" or else IntelliJ won't show any changes. But, if I do so I will also see changed files in proj2. How can I exclude proj2 or set the root to proj1 while still seeing my changes?

4

2 回答 2

1

You can hide folders in File -> Project Structure... -> Modules

Select your module, then select your folder, that you want to hide and then click to "Excluded".

enter image description here

于 2012-04-17T06:28:17.200 回答
0

This can be tricky because mercurial is intended to be used as One Project One Repo. By default mercurial will want to commit all files when an hg commit is ran. There is a command to commit specific files that is rarely used: hg commit -I file1.foo -I file2.foo -I file3.foo. So you are basically trying to tell IntelliJ to constantly run that type of command, but pretend you don't see the other files to know you need to run that type of a command.

When you go to commit in IntelliJ if you use the commit dialog you can see the files it wants to commit. You can uncheck the files from proj2. Usually IntelliJ remembers to continue to ignores these files from future commits, but if you select the commit dialog differently they may appear checked again.

Realistically you should pull each project out to their own repository. Then this and many other potential problems with the setup goes away. Read One Project One Repository - Mercurial Used Right for reasons why.

于 2012-04-26T00:20:43.337 回答