Handling directory moves via a VCS integration

I am working on a VCS integration (still targeting IDEA 6.0 at the moment) and am looking for the best way to handle directory moves. My first idea was to implement a LocalFileOperationsHandler, but I'm not sure if that's the best way. Here's an explanation of the issue:

Under this vcs, all files are read-only unless they are checked out for modification. When moving a directory, a command is issued to the vcs and it carries out the move operation. No files underneath the directory are checked out, however the directory itself is checked out as a part of the operation.

From what I've seen so far, IDEA wants to clear the read-only status of all files within a directory during a move operation, which is not desirable especially with large hierarchies. I'd like to get around this if possible.

Any advice or ideas?

3 comments

Hello Luke,

I am working on a VCS integration (still targeting IDEA 6.0 at the
moment) and am looking for the best way to handle directory moves. My
first idea was to implement a LocalFileOperationsHandler, but I'm not
sure if that's the best way. Here's an explanation of the issue:

Under this vcs, all files are read-only unless they are checked out
for modification. When moving a directory, a command is issued to the
vcs and it carries out the move operation. No files underneath the
directory are checked out, however the directory itself is checked out
as a part of the operation.

From what I've seen so far, IDEA wants to clear the read-only status
of all files within a directory during a move operation, which is not
desirable especially with large hierarchies. I'd like to get around
this if possible.


Unfortunately this isn't currently possible. The files are checked out by
the refactoring processor before the VCS is called to perform the move operation.
We would like to avoid this, but this will likely only be solved in IDEA
8 timeframe.

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


0

Dmitry,

Thanks for the quick answer. I suppose the alternative would be the following (in my case):
-Let IDEA run the check out operation, but keep a list of the checked out files (not including any files that were checked out in a previous operation)
-Roll back the checkout once the refactoring is complete

In this scenario, where should I look to build a list of the affected files?

Thanks,
Luke

0

Hello Luke,

Thanks for the quick answer. I suppose the alternative would be the
following (in my case):

-Let IDEA run the check out operation, but keep a list of the checked
out files (not including any files that were checked out in a previous
operation)

-Roll back the checkout once the refactoring is complete

In this scenario, where should I look to build a list of the affected
files?


You can collect the list of checked out files in your EditFileProvider implementation,
and use CommandListener.commandStarted() and commandFinished() to detect
the start and end of an operation.

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


0

Please sign in to leave a comment.