PerforceVcs EditFileProvider doesn't trigger "Clear Read-Only Status"

Hi,

I am new to the plugin development and my environment is Intellij 13 integrated with perforce.

In my plugin, here is what I did:

1. open a vitual file and analyse it.
2. based on file name, map to another file and create as a virtual file
3. edit this mapped virtal file which is version controlled by perforce.

Code:

         VirtualFile currentFile;
         VirtualFile mappedFile;

        AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(currentFile);
        EditFileProvider provider = vcs.getEditFileProvider();

        VirtualFile[] virtualFiles = new VirtualFile[] {mappedFile};

        try {
            provider.editFiles(virtualFiles);
        }
        catch(SomeException ex) {
          ...
        }

The mappedFile is actually checked out but no "Clear Read-Only Status" popup is triggered.

Did I miss something?


Thanks in advance.

johnmian.

2 comments
Comment actions Permalink

EditFileProvider is the low-level VCS-specific API that is used for actually making a file editable; you're not supposed to use it directly. Instead, use ReadonlyStatusHandler.ensureFilesWritable().

0
Comment actions Permalink

Dmitry,

That is it! Thanks for quick response.

Mian

0

Please sign in to leave a comment.