Search in sources :

Example 6 with CvsOperationExecutor

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

the class AbstractAction method performAction.

protected void performAction(final Project project, final CvsHandler handler, final CvsContext context) {
    final CvsOperationExecutor executor = new CvsOperationExecutor(project);
    executor.performActionSync(handler, new MyCvsOperationExecutorCallback(context, handler, executor));
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)

Example 7 with CvsOperationExecutor

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

the class CvsCheckinEnvironment method commit.

public List<VcsException> commit(List<Change> changes, String preparedComment, @NotNull NullableFunction<Object, Object> parametersHolder, Set<String> feedback) {
    final Collection<FilePath> filesList = ChangesUtil.getPaths(changes);
    FilePath[] files = filesList.toArray(new FilePath[filesList.size()]);
    final CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
    executor.setShowErrors(false);
    final List<File> dirsToPrune = new ArrayList<>();
    for (Change c : changes) {
        if (c.getType() == Change.Type.DELETED) {
            final ContentRevision contentRevision = c.getBeforeRevision();
            assert contentRevision != null;
            final FilePath path = contentRevision.getFile();
            final FilePath parentPath = path.getParentPath();
            if (parentPath != null) {
                dirsToPrune.add(parentPath.getIOFile());
            }
        }
    }
    final CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(myProject);
    CvsHandler handler = CommandCvsHandler.createCommitHandler(files, preparedComment, CvsBundle.message("operation.name.commit.file", files.length), cvsConfiguration.MAKE_NEW_FILES_READONLY, myProject, cvsConfiguration.TAG_AFTER_PROJECT_COMMIT, cvsConfiguration.TAG_AFTER_PROJECT_COMMIT_NAME, dirsToPrune);
    executor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
    return executor.getResult().getErrorsAndWarnings();
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) CvsHandler(com.intellij.cvsSupport2.cvshandlers.CvsHandler) CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) ContentRevision(com.intellij.openapi.vcs.changes.ContentRevision) Change(com.intellij.openapi.vcs.changes.Change) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Example 8 with CvsOperationExecutor

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

the class CvsVcs2 method executeOperation.

public static void executeOperation(String title, CvsOperation operation, final Project project) throws VcsException {
    CvsOperationExecutor executor = new CvsOperationExecutor(project);
    executor.performActionSync(new CommandCvsHandler(title, operation), CvsOperationExecutorCallback.EMPTY);
    CvsResult result = executor.getResult();
    if (result.hasErrors()) {
        throw result.composeError();
    }
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) CvsResult(com.intellij.openapi.cvsIntegration.CvsResult)

Example 9 with CvsOperationExecutor

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

the class CvsVcs2 method executeQuietOperation.

public static CvsOperationExecutor executeQuietOperation(String title, CvsOperation operation, final Project project) {
    CvsOperationExecutor executor = new CvsOperationExecutor(false, project, ModalityState.defaultModalityState());
    executor.setIsQuietOperation(true);
    executor.performActionSync(new CommandCvsHandler(title, operation), CvsOperationExecutorCallback.EMPTY);
    return executor;
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)

Example 10 with CvsOperationExecutor

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

the class TagsHelper method getBranchesProvider.

private static BranchesProvider getBranchesProvider(CvsOperation operation, Project project) throws VcsException {
    LOG.assertTrue(operation instanceof BranchesProvider);
    final CvsOperationExecutor executor = new CvsOperationExecutor(true, project, new ModalityContextImpl(ModalityState.defaultModalityState()));
    final CommandCvsHandler handler = new CommandCvsHandler(CvsBundle.message("load.tags.operation.name"), operation, true);
    executor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
    final CvsResult executionResult = executor.getResult();
    if (executionResult.hasErrors())
        throw executionResult.composeError();
    return (BranchesProvider) operation;
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) ModalityContextImpl(com.intellij.cvsSupport2.cvsExecution.ModalityContextImpl) 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