Search in sources :

Example 21 with CvsOperationExecutor

use of com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor in project intellij-community by JetBrains.

the class CvsAnnotationProvider method executeOperation.

private AnnotateOperation executeOperation(File file, String revision, CvsEnvironment root, boolean binary, boolean retryOnFailure) throws VcsException {
    final AnnotateOperation operation = new AnnotateOperation(file, revision, root, binary);
    final CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
    executor.performActionSync(new CommandCvsHandler(CvsBundle.getAnnotateOperationName(), operation), CvsOperationExecutorCallback.EMPTY);
    final CvsResult result = executor.getResult();
    if (result.hasErrors()) {
        if (!retryOnFailure) {
            throw result.composeError();
        }
        for (VcsException error : result.getErrors()) {
            for (String message : error.getMessages()) {
                if (message.contains(INVALID_OPTION_F) || message.contains(USAGE_CVSNTSRV_SERVER)) {
                    ourDoNotAnnotateBinaryRoots.add(root.getCvsRootAsString());
                    return executeOperation(file, revision, root, false, false);
                }
            }
        }
        throw result.composeError();
    }
    return operation;
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) VcsException(com.intellij.openapi.vcs.VcsException) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) AnnotateOperation(com.intellij.cvsSupport2.cvsoperations.cvsAnnotate.AnnotateOperation) CvsResult(com.intellij.openapi.cvsIntegration.CvsResult)

Aggregations

CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)21 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)17 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)7 CvsResult (com.intellij.openapi.cvsIntegration.CvsResult)7 File (java.io.File)4 FilePath (com.intellij.openapi.vcs.FilePath)3 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)2 DefaultCvsOperationExecutorCallback (com.intellij.cvsSupport2.cvsExecution.DefaultCvsOperationExecutorCallback)2 UpdateHandler (com.intellij.cvsSupport2.cvshandlers.UpdateHandler)2 GetFileContentOperation (com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation)2 UpdatedFilesProcessor (com.intellij.cvsSupport2.updateinfo.UpdatedFilesProcessor)2 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)2 VcsException (com.intellij.openapi.vcs.VcsException)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 List (java.util.List)2 NotNull (org.jetbrains.annotations.NotNull)2 CvsMergeProvider (com.intellij.cvsSupport2.actions.merge.CvsMergeProvider)1 UpdateSettings (com.intellij.cvsSupport2.actions.update.UpdateSettings)1 UpdateSettingsOnCvsConfiguration (com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)1 CvsChangeList (com.intellij.cvsSupport2.changeBrowser.CvsChangeList)1