EditFileProvider and file deletion

All,

More Custom Vcs trials and tribulations :)

This particular Vcs makes heavy use of read-only files. If a user opts to delete a file, the Clear Read-only Status dialog is shown to clear the read only status prior to deleting the file.

Ideally, I would like to have a VirtualFileListener which simply fires a vcs drop action when a user attempts to delete a file, however the issue described above makes the process very difficult (The dialog is shown before the listener is called).

The only workaround that I have been able to find is to have my EditFileProvider add a listener to CommandProcessor, and in the event of a delete action being issued, will perform a delete operation rather than a check out. This does not prevent the clear ready only status dialog from being shown - which I would really like to avoid.

Is there a better way to accomplish this on a read-only file?

Thanks in advance,

Steve

2 comments
Comment actions Permalink

Hello Steven,

More Custom Vcs trials and tribulations :)

This particular Vcs makes heavy use of read-only files. If a user opts
to delete a file, the Clear Read-only Status dialog is shown to clear
the read only status prior to deleting the file.

Ideally, I would like to have a VirtualFileListener which simply fires
a vcs drop action when a user attempts to delete a file, however the
issue described above makes the process very difficult (The dialog is
shown before the listener is called).

The only workaround that I have been able to find is to have my
EditFileProvider add a listener to CommandProcessor, and in the event
of a delete action being issued, will perform a delete operation
rather than a check out. This does not prevent the clear ready only
status dialog from being shown - which I would really like to avoid.

Is there a better way to accomplish this on a read-only file?


Is that really such a big problem for you to delete a file which has first
been checked out? Maybe you can simply revert the checkout before deleting
the file when delete is requested?

We would eventually like to avoid the "clear read-only status" prompt for
"safe delete" refactoring which deletes an entire file, but this turned to
be far from an easy fix.

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


0
Comment actions Permalink

Unfortunately it is - the Vcs refuses to do a drop if the file has been modified in any way (including being made writable or checked out).

The problem with reverting after check out is that it requires the user to go through some additional prompts - I was wanting to streamline the process by only showing one dialog (the drop dialog). It might be a little confusing that when someone goes to delete a file, they get a checkout prompt, followd by a revert prompt, and then a final drop prompt.

Steve

0

Please sign in to leave a comment.