VCS api behavior questions

I have been playing with the VCS api a bit more this weekend and saw a
couple of things that suprised me.

1- When a Vcs plugin is loaded, how come its AbstractVcs.getName() method
gets called EVERY SECOND forever, even when the current open project does
NOT use the plugin?

2- When two modules are controlled by two different VCS, how come module 1
's VCS gets asked questions about files in module 2? Specifically, the VCS
plugin in charge of module 1 gets asked
AbstractVcs.getUpToDateRevisionProvider().itemCanBePurged() for every file
in module 2! Why? Shouldn't VCS plugins have to worry ONLY about the modules
they're controling? (In my case, both modules have very distinct content
roots)

Thanks,

Vince.


2 comments
Comment actions Permalink

Hello Vincent,

VM> I have been playing with the VCS api a bit more this weekend and saw
VM> a couple of things that suprised me.
VM>
VM> 1- When a Vcs plugin is loaded, how come its AbstractVcs.getName()
VM> method gets called EVERY SECOND forever, even when the current open
VM> project does NOT use the plugin?

This is expected. IDEA searches for the active VCS instance by comparing
the names of all registered VCS instances with the name of the active VCS,
so it calls getName() on all VCSes until it finds a match.

VM> 2- When two modules are controlled by two different VCS, how come
VM> module 1 's VCS gets asked questions about files in module 2?
VM> Specifically, the VCS plugin in charge of module 1 gets asked
VM> AbstractVcs.getUpToDateRevisionProvider().itemCanBePurged() for
VM> every file in module 2! Why? Shouldn't VCS plugins have to worry
VM> ONLY about the modules they're controling? (In my case, both modules
VM> have very distinct content roots)

This is most likely a bug. Could you please send the call stack for the incorrect
call to itemCanBePurged()?

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hello Dmitry,

This is expected. IDEA searches for the active VCS instance by comparing
the names of all registered VCS instances with the name of the active VCS,
so it calls getName() on all VCSes until it finds a match.


"Until it finds a match" means it should stop at some point, right? :)

In the following situation:
two vcs plugins installed
- Clearcase cvs
- Fake vcs
project open, two modules.
- module 1, NO vcs
- module 2, Clearcase vcs

the "getName()" method of Fake vcs gets called every second
indefinitely as long as the project is open. Fake vcs is not
referenced anywhere, it is not used by the project. I can understand
how it could be called a few times, but every second for ever?

This is most likely a bug. Could you please send the call stack for the
incorrect call to itemCanBePurged()?


Here you go. It looks like it's the same stacktrace for all calls. This one
happened while the project was being loaded (or immediately after).
at
com.jfouffa.fakevcs.FakeUpToDateRevisionProvider.itemCanBePurged(FakeUpToDateRevisionProvider.java:33)
at
com.intellij.openapi.vcs.impl.ModuleLevelVcsManagerImpl.itemCanBePurged(ModuleLevelVcsManagerImpl.java:11)
at
com.intellij.localVcs.impl.LocalVcsPurgingProviderImpl.itemCanBePurged(LocalVcsPurgingProviderImpl.java:9)
at
com.intellij.localVcs.impl.LocalVcsImpl.canPurgeItem(LocalVcsImpl.java:436)
at com.intellij.localVcs.impl.FindItemsToPurge.c(FindItemsToPurge.java:9)
at com.intellij.localVcs.impl.FindItemsToPurge.a(FindItemsToPurge.java:21)
at
com.intellij.localVcs.impl.FindItemsToPurge.execute(FindItemsToPurge.java:77)
at com.intellij.localVcs.impl.Repository.purge(Repository.java:216)
at com.intellij.localVcs.impl.LocalVcsStore.purge(LocalVcsStore.java:13)
at com.intellij.localVcs.impl.LocalVcsImpl.a(LocalVcsImpl.java:141)
at com.intellij.localVcs.impl.LocalVcsImpl.purge(LocalVcsImpl.java:186)
at com.intellij.localVcs.impl.LocalVcsImpl.b(LocalVcsImpl.java:257)
at com.intellij.localVcs.impl.LocalVcsImpl.endAction(LocalVcsImpl.java:318)
at
com.intellij.openapi.localVcs.impl.LvcsActionImpl.finish(LvcsActionImpl.java:6)
at
com.intellij.localVcs.impl.StructureSyncOperation.saveVcs(StructureSyncOperation.java:34)
at
com.intellij.localVcs.impl.DelayedSyncOperation.updatingDone(DelayedSyncOperation.java:38)
at
com.intellij.localVcs.impl.LocalVcsImpl$4.updatingDone(LocalVcsImpl.java:1)
at
com.intellij.ide.startup.FileSystemSynchronizer.b(FileSystemSynchronizer.java:46)
at
com.intellij.ide.startup.FileSystemSynchronizer.collectFilesToUpdate(FileSystemSynchronizer.java:7)
at
com.intellij.ide.startup.FileSystemSynchronizer.execute(FileSystemSynchronizer.java:65)
at
com.intellij.ide.startup.impl.StartupManagerImpl$1.run(StartupManagerImpl.java:0)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:357)
at
com.intellij.ide.startup.impl.StartupManagerImpl.runStartupActivities(StartupManagerImpl.java:9)
at
com.intellij.openapi.project.impl.ProjectManagerImpl$4.run(ProjectManagerImpl.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:24)
at
com.intellij.openapi.application.impl.ApplicationImpl$1MyThread.run(ApplicationImpl.java:8)

Thanks,

Vince.


0

Please sign in to leave a comment.