There are 3 modules in the attached sample project: module1, module2 and top-level-module.
The first two are regular modules associated with subdirectories of the project dir. The top-level-module is special, it's content root is set to the project dir, so it contains all project files that are outside of module1 and module2. In other words, it contains the file excluded.txt.
I then marked the content root of top-level-module as excluded, with the intention of excluding the excluded.txt file from the project, but this resulted in excluded.txt reappearing under the project view. In other words, IDEA simply ignored my request to exclude the files in top-level-module from the project.
The expected result is for excluded.txt to be completely excluded from the project (but not to exclude any files residing in module1 and module2, of course).
entry 'module2' already exists in 'C:/temp/project'
java.lang.RuntimeException: entry 'module2' already exists in 'C:/temp/project'
at com.intellij.history.core.tree.DirectoryEntry.checkDoesNotExist(DirectoryEntry.java:55)
at com.intellij.history.core.tree.DirectoryEntry.addChild(DirectoryEntry.java:8)
at com.intellij.history.core.changes.CreateEntryChange.addEntry(CreateEntryChange.java:2)
at com.intellij.history.core.changes.CreateDirectoryChange.doApplyTo(CreateDirectoryChange.java:3)
at com.intellij.history.core.changes.StructuralChange.applyTo(StructuralChange.java:18)
at com.intellij.history.core.LocalVcs.a(LocalVcs.java:6)
at com.intellij.history.core.LocalVcs.a(LocalVcs.java:28)
at com.intellij.history.core.LocalVcs.createDirectory(LocalVcs.java:64)
at com.intellij.history.core.ThreadSafeLocalVcs.createDirectory(ThreadSafeLocalVcs.java:27)
at com.intellij.history.integration.Updater.c(Updater.java:81)
at com.intellij.history.integration.Updater.b(Updater.java:54)
at com.intellij.history.integration.Updater.queryNeededFiles(Updater.java:45)
at com.intellij.history.integration.LocalHistoryService$CacheUpdaterAdaptor.queryNeededFiles(LocalHistoryService.java:1)
at com.intellij.ide.startup.FileSystemSynchronizer.collectFilesToUpdate(FileSystemSynchronizer.java:92)
at com.intellij.ide.startup.FileSystemSynchronizer.execute(FileSystemSynchronizer.java:53)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$6.run(ProjectRootManagerImpl.java:2)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:1)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:57)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:45)
at com.intellij.openapi.application.impl.ApplicationImpl$7$1.run(ApplicationImpl.java:2)
at com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:5)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:1)