Search in sources :

Example 1 with CorruptedProjectFilesDialog

use of com.intellij.cvsSupport2.cvsoperations.cvsUpdate.ui.CorruptedProjectFilesDialog in project intellij-community by JetBrains.

the class UpdateHandler method onOperationFinished.

@Override
protected void onOperationFinished(ModalityContext modalityContext) {
    if (myUpdateSettings.getPruneEmptyDirectories()) {
        final IOFilesBasedDirectoryPruner pruner = new IOFilesBasedDirectoryPruner(ProgressManager.getInstance().getProgressIndicator());
        for (FilePath file : myFiles) {
            pruner.addFile(file.getIOFile());
        }
        pruner.execute();
    }
    if (!myCorruptedFiles.isEmpty()) {
        final int showOptions = CvsConfiguration.getInstance(myProject).SHOW_CORRUPTED_PROJECT_FILES;
        if (showOptions == Options.PERFORM_ACTION_AUTOMATICALLY) {
            for (final MergedWithConflictProjectOrModuleFile myCorruptedFile : myCorruptedFiles) {
                myCorruptedFile.setShouldBeCheckedOut();
            }
        } else if (showOptions == Options.SHOW_DIALOG) {
            modalityContext.runInDispatchThread(() -> new CorruptedProjectFilesDialog(myProject, myCorruptedFiles).show(), myProject);
        }
        final VcsKey vcsKey = CvsVcs2.getKey();
        for (final MergedWithConflictProjectOrModuleFile myCorruptedFile : myCorruptedFiles) {
            if (myCorruptedFile.shouldBeCheckedOut()) {
                addFileToCheckout(myCorruptedFile.getOriginal());
            } else {
                myUpdatedFiles.getGroupById(FileGroup.MODIFIED_ID).add(myCorruptedFile.getOriginal().getPath(), vcsKey, null);
            }
        }
    }
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) VcsKey(com.intellij.openapi.vcs.VcsKey) CorruptedProjectFilesDialog(com.intellij.cvsSupport2.cvsoperations.cvsUpdate.ui.CorruptedProjectFilesDialog) MergedWithConflictProjectOrModuleFile(com.intellij.cvsSupport2.cvsoperations.cvsUpdate.MergedWithConflictProjectOrModuleFile)

Aggregations

MergedWithConflictProjectOrModuleFile (com.intellij.cvsSupport2.cvsoperations.cvsUpdate.MergedWithConflictProjectOrModuleFile)1 CorruptedProjectFilesDialog (com.intellij.cvsSupport2.cvsoperations.cvsUpdate.ui.CorruptedProjectFilesDialog)1 FilePath (com.intellij.openapi.vcs.FilePath)1 VcsKey (com.intellij.openapi.vcs.VcsKey)1