Search in sources :

Example 6 with CvsConfiguration

use of com.intellij.cvsSupport2.config.CvsConfiguration in project intellij-community by JetBrains.

the class UpdateOptionsPanel method apply.

public void apply() throws ConfigurationException {
    CvsConfiguration configuration = CvsConfiguration.getInstance(myProject);
    configuration.CLEAN_COPY = false;
    if (myCleanCopy.isSelected()) {
        if (Messages.showYesNoDialog(CvsBundle.message("confirmation.clean.copy"), CvsBundle.message("confirmation.title.clean.copy"), Messages.getWarningIcon()) == Messages.YES) {
            configuration.CLEAN_COPY = true;
        } else {
            throw new CancelledConfigurationException();
        }
    }
    configuration.PRUNE_EMPTY_DIRECTORIES = myPruneEmptyDirectories.isSelected();
    configuration.MERGING_MODE = getSelected(myMergingGroup);
    configuration.MERGE_WITH_BRANCH1_NAME = myBranch.getText();
    configuration.MERGE_WITH_BRANCH2_NAME = myBranch2.getText();
    configuration.RESET_STICKY = mySwitchToHeadRevision.isSelected();
    configuration.CREATE_NEW_DIRECTORIES = myCreateNewDirectories.isSelected();
    final KeywordSubstitution keywordSubstitution = myChangeKeywordSubstitutionPanel.getKeywordSubstitution();
    if (keywordSubstitution == null) {
        configuration.UPDATE_KEYWORD_SUBSTITUTION = null;
    } else {
        configuration.UPDATE_KEYWORD_SUBSTITUTION = keywordSubstitution.toString();
    }
    myDateOrRevisionOrTagSettings.saveTo(configuration.UPDATE_DATE_OR_REVISION_SETTINGS);
}
Also used : CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) CancelledConfigurationException(com.intellij.openapi.options.CancelledConfigurationException) KeywordSubstitution(org.netbeans.lib.cvsclient.command.KeywordSubstitution)

Example 7 with CvsConfiguration

use of com.intellij.cvsSupport2.config.CvsConfiguration 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)

Example 8 with CvsConfiguration

use of com.intellij.cvsSupport2.config.CvsConfiguration 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 9 with CvsConfiguration

use of com.intellij.cvsSupport2.config.CvsConfiguration in project intellij-community by JetBrains.

the class CvsConfigurationPanel method updateFrom.

public void updateFrom(CvsConfiguration config, CvsApplicationLevelConfiguration appLevelConfiguration) {
    myConfigurations = new ArrayList<>(appLevelConfiguration.CONFIGURATIONS);
    myShowOutput.setSelected(config.SHOW_OUTPUT);
    myMakeNewFilesReadOnly.setSelected(config.MAKE_NEW_FILES_READONLY);
    myOnFileMergedWithConflictGroup[config.SHOW_CORRUPTED_PROJECT_FILES].setSelected(true);
    myDefaultTextFileKeywordSubstitution.removeAllItems();
    for (final KeywordSubstitutionWrapper keywordSubstitution : KeywordSubstitutionWrapper.values()) {
        myDefaultTextFileKeywordSubstitution.addItem(keywordSubstitution);
    }
    myDefaultTextFileKeywordSubstitution.setSelectedItem(KeywordSubstitutionWrapper.getValue(config.DEFAULT_TEXT_FILE_SUBSTITUTION));
}
Also used : KeywordSubstitutionWrapper(com.intellij.cvsSupport2.keywordSubstitution.KeywordSubstitutionWrapper)

Aggregations

CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)6 UpdateSettingsOnCvsConfiguration (com.intellij.cvsSupport2.actions.update.UpdateSettingsOnCvsConfiguration)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)2 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)2 Project (com.intellij.openapi.project.Project)2 FilePath (com.intellij.openapi.vcs.FilePath)2 File (java.io.File)2 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)1 CvsRootConfiguration (com.intellij.cvsSupport2.config.CvsRootConfiguration)1 DateOrRevisionSettings (com.intellij.cvsSupport2.config.DateOrRevisionSettings)1 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)1 UpdateHandler (com.intellij.cvsSupport2.cvshandlers.UpdateHandler)1 WatchOperation (com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)1 WatcherDialog (com.intellij.cvsSupport2.cvsoperations.cvsWatch.ui.WatcherDialog)1 KeywordSubstitutionWrapper (com.intellij.cvsSupport2.keywordSubstitution.KeywordSubstitutionWrapper)1 MigrateRootDialog (com.intellij.cvsSupport2.ui.MigrateRootDialog)1 UpdatedFilesProcessor (com.intellij.cvsSupport2.updateinfo.UpdatedFilesProcessor)1 AccessToken (com.intellij.openapi.application.AccessToken)1 CvsResult (com.intellij.openapi.cvsIntegration.CvsResult)1