Search in sources :

Example 1 with UpdateHandler

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

the class CvsStatusEnvironment method updateDirectories.

@NotNull
public UpdateSession updateDirectories(@NotNull FilePath[] contentRoots, final UpdatedFiles updatedFiles, ProgressIndicator progressIndicator, @NotNull final Ref<SequentialUpdatesContext> context) {
    final UpdateSettings updateSettings = UpdateSettings.DONT_MAKE_ANY_CHANGES;
    final UpdateHandler handler = CommandCvsHandler.createUpdateHandler(contentRoots, updateSettings, myProject, updatedFiles);
    handler.addCvsListener(new UpdatedFilesProcessor(updatedFiles));
    CvsOperationExecutor cvsOperationExecutor = new CvsOperationExecutor(true, myProject, ModalityState.defaultModalityState());
    cvsOperationExecutor.setShowErrors(false);
    cvsOperationExecutor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
    final CvsResult result = cvsOperationExecutor.getResult();
    return new UpdateSessionAdapter(result.getErrorsAndWarnings(), result.isCanceled());
}
Also used : UpdateHandler(com.intellij.cvsSupport2.cvshandlers.UpdateHandler) UpdatedFilesProcessor(com.intellij.cvsSupport2.updateinfo.UpdatedFilesProcessor) CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) UpdateSettings(com.intellij.cvsSupport2.actions.update.UpdateSettings) CvsResult(com.intellij.openapi.cvsIntegration.CvsResult) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with UpdateHandler

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

the class CvsUpdateEnvironment method updateDirectories.

@NotNull
public UpdateSession updateDirectories(@NotNull FilePath[] contentRoots, final UpdatedFiles updatedFiles, ProgressIndicator progressIndicator, @NotNull final Ref<SequentialUpdatesContext> contextRef) {
    CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(myProject);
    if (!myLastUpdateWasConfigured) {
        cvsConfiguration.CLEAN_COPY = false;
        cvsConfiguration.RESET_STICKY = false;
    }
    myLastUpdateWasConfigured = false;
    try {
        final UpdateSettingsOnCvsConfiguration updateSettings = createSettingsAndUpdateContext(cvsConfiguration, contextRef);
        final UpdateHandler handler = CommandCvsHandler.createUpdateHandler(contentRoots, updateSettings, myProject, updatedFiles);
        handler.addCvsListener(new UpdatedFilesProcessor(updatedFiles));
        CvsOperationExecutor cvsOperationExecutor = new CvsOperationExecutor(true, myProject, ModalityState.defaultModalityState());
        cvsOperationExecutor.setShowErrors(false);
        cvsOperationExecutor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
        final CvsResult result = cvsOperationExecutor.getResult();
        return createUpdateSessionAdapter(updatedFiles, result);
    } finally {
        cvsConfiguration.CLEAN_COPY = false;
        cvsConfiguration.RESET_STICKY = false;
    }
}
Also used : UpdateHandler(com.intellij.cvsSupport2.cvshandlers.UpdateHandler) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) UpdatedFilesProcessor(com.intellij.cvsSupport2.updateinfo.UpdatedFilesProcessor) CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration) CvsResult(com.intellij.openapi.cvsIntegration.CvsResult) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)2 UpdateHandler (com.intellij.cvsSupport2.cvshandlers.UpdateHandler)2 UpdatedFilesProcessor (com.intellij.cvsSupport2.updateinfo.UpdatedFilesProcessor)2 CvsResult (com.intellij.openapi.cvsIntegration.CvsResult)2 NotNull (org.jetbrains.annotations.NotNull)2 UpdateSettings (com.intellij.cvsSupport2.actions.update.UpdateSettings)1 UpdateSettingsOnCvsConfiguration (com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)1 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)1