ChangeProvider Question

Yet another Vcs question ;)

Is there a way to prevent getChanges() being called on certain files?

This particular Vcs keeps metadata files in the filesystem. When a file is checked out/modified, etc. ChangeProvider is being called for that file.

I have tried to ignore the file from within the ChangeProvider, however, if a user attempts to refresh file status after it is ignored, the Changelist returned is empty. (subsequent refreshes return correctly)

I do not want to check the content roots in the event all of the files being checked are ignored - this would end up causing getChanges() to be invoked twice for any change in the file system.

Is there a way to instruct IDEA to ignore certain files? For what its worth, I have registered a FileType for this file, and is added to the ignored file list in FileTypeManager.

Thanks in advance,

Steve

2 comments
Comment actions Permalink

Hello Steven,

Yet another Vcs question ;)

Is there a way to prevent getChanges() being called on certain files?

This particular Vcs keeps metadata files in the filesystem. When a
file is checked out/modified, etc. ChangeProvider is being called for
that file.

I have tried to ignore the file from within the ChangeProvider,
however, if a user attempts to refresh file status after it is
ignored, the Changelist returned is empty.

I do not want to check the content roots in the event all of the files
being checked are ignored - this would end up causing getChanges() to
be invoked twice for any chance in the file system.

Is there a way to instruct IDEA to ignore certain files? For what its
worth, I have registered a FileType for this file, and is added to the
ignored file list in FileTypeManager.


The proper way to handle this is to add your metadata files to Settings |
General | Ignore files and folders. For an example of doing this programmatically,
you can look at VssVcs.addIgnoredFiles() in the Visual SourceSafe plugin
sources (available in the Plugin Development Kit).

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


0
Comment actions Permalink

Hmm. That is exactly how I implemented it.

I think I found the issue:

When implementing ChangeProvider, if there are no dirty files in VcsDirtyScope, you must check the recursive dirty directories. Before, I was checking the content roots. Once I switched, everything began working correctly.

Thanks!

Steve

0

Please sign in to leave a comment.