Search in sources :

Example 16 with CommandCvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.

the class CommandCvsHandler method createBranchHandler.

public static CvsHandler createBranchHandler(FilePath[] selectedFiles, String branchName, boolean switchToThisBranch, boolean overrideExisting, boolean makeNewFilesReadOnly, Project project) {
    final CompositeOperation operation = new CompositeOperation();
    operation.addOperation(new BranchOperation(selectedFiles, branchName, overrideExisting));
    if (switchToThisBranch) {
        operation.addOperation(new UpdateOperation(selectedFiles, branchName, makeNewFilesReadOnly, project));
    }
    return new CommandCvsHandler(CvsBundle.message("operation.name.create.branch"), operation, FileSetToBeUpdated.selectedFiles(selectedFiles));
}
Also used : BranchOperation(com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.BranchOperation) UpdateOperation(com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation)

Example 17 with CommandCvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.

the class ComparableVcsRevisionOnOperation method loadContent.

public byte[] loadContent() throws IOException, VcsException {
    if (!myOperation.isLoaded()) {
        CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
        executor.performActionSync(new CommandCvsHandler(CvsBundle.message("operation.name.load.file"), myOperation), CvsOperationExecutorCallback.EMPTY);
        CvsResult result = executor.getResult();
        if (result.isCanceled()) {
            throw new ProcessCanceledException();
        }
        if (result.hasErrors()) {
            throw result.composeError();
        }
    }
    return getContent();
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) CvsResult(com.intellij.openapi.cvsIntegration.CvsResult) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException)

Example 18 with CommandCvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.

the class AbstractWatchAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    CvsConfiguration configuration = CvsConfiguration.getInstance(context.getProject());
    WatcherDialog dialog = createDialog(configuration, context);
    if (!dialog.showAndGet()) {
        return CvsHandler.NULL;
    }
    Watch watch = dialog.getWatch();
    saveWatch(configuration, watch);
    WatchOperation watchOperation = new WatchOperation(getWatchOperation(), watch);
    VirtualFile[] files = context.getSelectedFiles();
    for (int i = 0; i < files.length; i++) {
        watchOperation.addFile(files[i]);
    }
    return new CommandCvsHandler(getTitle(context), watchOperation);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) WatcherDialog(com.intellij.cvsSupport2.cvsoperations.cvsWatch.ui.WatcherDialog) Watch(org.netbeans.lib.cvsclient.command.Watch) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) WatchOperation(com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)

Example 19 with CommandCvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.

the class AbstractWatchOnOffAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    WatchOperation watchOperation = new WatchOperation(getMode());
    VirtualFile[] files = context.getSelectedFiles();
    for (VirtualFile file : files) {
        watchOperation.addFile(file);
    }
    return new CommandCvsHandler(getTitle(context), watchOperation);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) WatchOperation(com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)

Example 20 with CommandCvsHandler

use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler 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

CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)12 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)6 CvsResult (com.intellij.openapi.cvsIntegration.CvsResult)5 File (java.io.File)4 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)3 VcsException (com.intellij.openapi.vcs.VcsException)3 CheckoutProjectOperation (com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation)2 GetFileContentOperation (com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation)2 TagOperation (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation)2 UpdateOperation (com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation)2 WatchOperation (com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)2 SimpleRevision (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)2 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)2 IOException (java.io.IOException)2 CvsEntriesManager (com.intellij.cvsSupport2.application.CvsEntriesManager)1 CvsChangeList (com.intellij.cvsSupport2.changeBrowser.CvsChangeList)1 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)1 DefaultCvsOperationExecutorCallback (com.intellij.cvsSupport2.cvsExecution.DefaultCvsOperationExecutorCallback)1 ModalityContextImpl (com.intellij.cvsSupport2.cvsExecution.ModalityContextImpl)1