Search in sources :

Example 1 with UpdateSettingsOnCvsConfiguration

use of com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration in project intellij-community by JetBrains.

the class CvsUpdateEnvironment method createSettingsAndUpdateContext.

private static UpdateSettingsOnCvsConfiguration createSettingsAndUpdateContext(final CvsConfiguration cvsConfiguration, @NotNull final Ref<SequentialUpdatesContext> contextRef) {
    if (contextRef.get() != null) {
        final CvsSequentialUpdateContext cvsContext = (CvsSequentialUpdateContext) contextRef.get();
        contextRef.set(null);
        return cvsContext.getConfiguration();
    }
    if ((!cvsConfiguration.CLEAN_COPY) && cvsConfiguration.UPDATE_DATE_OR_REVISION_SETTINGS.overridesDefault() && (cvsConfiguration.MERGING_MODE != CvsConfiguration.DO_NOT_MERGE)) {
        // split into 2 updates
        final UpdateSettingsOnCvsConfiguration secondUpdate = new UpdateSettingsOnCvsConfiguration(cvsConfiguration.PRUNE_EMPTY_DIRECTORIES, cvsConfiguration.MERGING_MODE, cvsConfiguration.MERGE_WITH_BRANCH1_NAME, cvsConfiguration.MERGE_WITH_BRANCH2_NAME, cvsConfiguration.CREATE_NEW_DIRECTORIES, cvsConfiguration.UPDATE_KEYWORD_SUBSTITUTION, new DateOrRevisionSettings(), cvsConfiguration.MAKE_NEW_FILES_READONLY, cvsConfiguration.CLEAN_COPY, cvsConfiguration.RESET_STICKY);
        contextRef.set(new CvsSequentialUpdateContext(secondUpdate, cvsConfiguration.UPDATE_DATE_OR_REVISION_SETTINGS.asString()));
        return new UpdateSettingsOnCvsConfiguration(cvsConfiguration.PRUNE_EMPTY_DIRECTORIES, CvsConfiguration.DO_NOT_MERGE, null, null, cvsConfiguration.CREATE_NEW_DIRECTORIES, cvsConfiguration.UPDATE_KEYWORD_SUBSTITUTION, cvsConfiguration.UPDATE_DATE_OR_REVISION_SETTINGS, cvsConfiguration.MAKE_NEW_FILES_READONLY, cvsConfiguration.CLEAN_COPY, cvsConfiguration.RESET_STICKY);
    } else {
        // usual way
        return new UpdateSettingsOnCvsConfiguration(cvsConfiguration, cvsConfiguration.CLEAN_COPY, cvsConfiguration.RESET_STICKY);
    }
}
Also used : DateOrRevisionSettings(com.intellij.cvsSupport2.config.DateOrRevisionSettings) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)

Example 2 with UpdateSettingsOnCvsConfiguration

use of com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration in project intellij-community by JetBrains.

the class GetFileFromRepositoryAction method getCvsHandler.

protected CvsHandler getCvsHandler(CvsContext context) {
    CvsLightweightFile[] cvsLightweightFiles = context.getSelectedLightweightFiles();
    Project project = context.getProject();
    if (cvsLightweightFiles != null) {
        boolean makeNewFilesReadOnly = project != null && CvsConfiguration.getInstance(project).MAKE_NEW_FILES_READONLY;
        return CommandCvsHandler.createGetFileFromRepositoryHandler(cvsLightweightFiles, makeNewFilesReadOnly);
    }
    final FilePath[] filePaths = context.getSelectedFilePaths();
    if (filePaths != null) {
        CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(project);
        // do not use -j's
        final UpdateSettingsOnCvsConfiguration updateSettings = new UpdateSettingsOnCvsConfiguration(cvsConfiguration, cvsConfiguration.CLEAN_COPY, cvsConfiguration.RESET_STICKY);
        return CommandCvsHandler.createUpdateHandler(filePaths, updateSettings, project, UpdatedFiles.create());
    }
    return CvsHandler.NULL;
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) Project(com.intellij.openapi.project.Project) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration) CvsLightweightFile(com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile) UpdateSettingsOnCvsConfiguration(com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)

Example 3 with UpdateSettingsOnCvsConfiguration

use of com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration 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

UpdateSettingsOnCvsConfiguration (com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)3 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)2 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)1 DateOrRevisionSettings (com.intellij.cvsSupport2.config.DateOrRevisionSettings)1 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)1 UpdateHandler (com.intellij.cvsSupport2.cvshandlers.UpdateHandler)1 UpdatedFilesProcessor (com.intellij.cvsSupport2.updateinfo.UpdatedFilesProcessor)1 CvsResult (com.intellij.openapi.cvsIntegration.CvsResult)1 Project (com.intellij.openapi.project.Project)1 FilePath (com.intellij.openapi.vcs.FilePath)1 NotNull (org.jetbrains.annotations.NotNull)1