use of com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile 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;
}
use of com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile 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.actions.cvsContext.CvsLightweightFile in project intellij-community by JetBrains.
the class CvsAnnotationProvider method annotate.
public FileAnnotation annotate(VirtualFile virtualFile) throws VcsException {
final File file = new File(virtualFile.getPath());
final File cvsLightweightFile = CvsUtil.getCvsLightweightFileForFile(file);
final String revision = CvsUtil.getRevisionFor(file);
final CvsEntriesManager entriesManager = CvsEntriesManager.getInstance();
final CvsConnectionSettings root = entriesManager.getCvsConnectionSettingsFor(file.getParentFile());
final boolean binary = annotateBinary(virtualFile, root);
final AnnotateOperation operation = executeOperation(cvsLightweightFile, revision, root, binary, true);
final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(virtualFile);
final List<VcsFileRevision> revisions = myCvsHistoryProvider.createRevisions(filePath);
final Annotation[] lineAnnotations = operation.getLineAnnotations();
adjustAnnotation(revisions, lineAnnotations);
return new CvsFileAnnotation(operation.getContent(), lineAnnotations, revisions, virtualFile, revision, myProject);
}
Aggregations