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);
}
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();
}
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());
}
Aggregations