Search in sources :

Example 1 with CheckoutProjectOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation in project intellij-community by JetBrains.

the class CommandCvsHandler method createGetFileFromRepositoryHandler.

public static CvsHandler createGetFileFromRepositoryHandler(CvsLightweightFile[] cvsLightweightFiles, boolean makeNewFilesReadOnly) {
    final CompositeOperation compositeOperation = new CompositeOperation();
    final CvsEntriesManager entriesManager = CvsEntriesManager.getInstance();
    for (CvsLightweightFile cvsLightweightFile : cvsLightweightFiles) {
        final File root = cvsLightweightFile.getRoot();
        File workingDirectory = root;
        if (workingDirectory == null)
            continue;
        if (cvsLightweightFile.getLocalFile().getParentFile().equals(workingDirectory)) {
            workingDirectory = workingDirectory.getParentFile();
        }
        final String alternativeCheckoutPath = getAlternativeCheckoutPath(cvsLightweightFile, workingDirectory);
        final CheckoutProjectOperation checkoutFileOperation = new CheckoutProjectOperation(new String[] { cvsLightweightFile.getModuleName() }, entriesManager.getCvsConnectionSettingsFor(root), makeNewFilesReadOnly, workingDirectory, alternativeCheckoutPath, true, null);
        compositeOperation.addOperation(checkoutFileOperation);
    }
    return new CommandCvsHandler(CvsBundle.message("action.name.get.file.from.repository"), compositeOperation, FileSetToBeUpdated.allFiles(), true);
}
Also used : CvsLightweightFile(com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile) CheckoutProjectOperation(com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation) CvsEntriesManager(com.intellij.cvsSupport2.application.CvsEntriesManager) VirtualFile(com.intellij.openapi.vfs.VirtualFile) CvsLightweightFile(com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile) File(java.io.File)

Example 2 with CheckoutProjectOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation in project intellij-community by JetBrains.

the class CvsServicesImpl method checkout.

public CvsResult checkout(String[] modules, File checkoutTo, String directory, boolean makeNewFilesReadOnly, boolean pruneEmptyDirectories, Object keywordSubstitution, Project project, CvsRepository repository) {
    LOG.assertTrue(modules.length > 0);
    CheckoutProjectOperation operation = new CheckoutProjectOperation(modules, CvsRootConfiguration.createOn(repository), makeNewFilesReadOnly, checkoutTo, directory, pruneEmptyDirectories, (KeywordSubstitution) keywordSubstitution);
    final CvsOperationExecutor executor = new CvsOperationExecutor(project);
    executor.performActionSync(new CommandCvsHandler(CvsBundle.message("operation.name.checkout"), operation, true), CvsOperationExecutorCallback.EMPTY);
    return executor.getResult();
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) CheckoutProjectOperation(com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)

Example 3 with CheckoutProjectOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation in project intellij-community by JetBrains.

the class CheckoutProjectOperation method create.

public static CheckoutProjectOperation create(CvsEnvironment env, String[] moduleName, File targetLocation, boolean useAlternativeCheckoutDir, boolean makeNewFilesReadOnly) {
    final CvsApplicationLevelConfiguration config = CvsApplicationLevelConfiguration.getInstance();
    final KeywordSubstitutionWrapper substitution = KeywordSubstitutionWrapper.getValue(config.CHECKOUT_KEYWORD_SUBSTITUTION);
    final File root;
    final String directory;
    if (useAlternativeCheckoutDir && targetLocation.getParentFile() == null) {
        root = targetLocation;
        directory = getModuleRootName(moduleName);
    } else if (useAlternativeCheckoutDir) {
        root = targetLocation.getParentFile();
        directory = targetLocation.getName();
    } else {
        root = targetLocation;
        directory = null;
    }
    return new CheckoutProjectOperation(moduleName, env, makeNewFilesReadOnly, root, directory, config.CHECKOUT_PRUNE_EMPTY_DIRECTORIES, substitution == null ? null : substitution.getSubstitution());
}
Also used : CvsApplicationLevelConfiguration(com.intellij.cvsSupport2.config.CvsApplicationLevelConfiguration) KeywordSubstitutionWrapper(com.intellij.cvsSupport2.keywordSubstitution.KeywordSubstitutionWrapper) File(java.io.File)

Aggregations

CheckoutProjectOperation (com.intellij.cvsSupport2.cvsoperations.cvsCheckOut.CheckoutProjectOperation)2 File (java.io.File)2 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)1 CvsEntriesManager (com.intellij.cvsSupport2.application.CvsEntriesManager)1 CvsApplicationLevelConfiguration (com.intellij.cvsSupport2.config.CvsApplicationLevelConfiguration)1 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)1 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)1 KeywordSubstitutionWrapper (com.intellij.cvsSupport2.keywordSubstitution.KeywordSubstitutionWrapper)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1