use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class CvsHistoryProvider method createRevisions.
@Nullable
public List<VcsFileRevision> createRevisions(final FilePath filePath) {
final File file = filePath.getIOFile();
final VirtualFile root = CvsVfsUtil.refreshAndFindFileByIoFile(file.getParentFile());
// check if we have a history pane open for a file in a package which has just been deleted
if (root == null)
return null;
final CvsConnectionSettings env = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(filePath.getVirtualFileParent());
final File lightweightFileForFile = CvsUtil.getCvsLightweightFileForFile(file);
return createRevisions(env, lightweightFileForFile);
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class CvsEntriesManager method createConnectionSettingsOn.
public CvsConnectionSettings createConnectionSettingsOn(String cvsRoot) {
if (!myStringToSettingsMap.containsKey(cvsRoot)) {
final CvsRootConfiguration rootConfiguration = myApplicationLevelConfiguration.getConfigurationForCvsRoot(cvsRoot);
CvsConnectionSettings settings = new IDEARootFormatter(rootConfiguration).createConfiguration();
myStringToSettingsMap.put(cvsRoot, settings);
}
return myStringToSettingsMap.get(cvsRoot);
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class RTagOperation method createOn.
public static RTagOperation[] createOn(FilePath[] files, String tagName, boolean overrideExisting) {
Map<CvsEnvironment, List<File>> envToFiles = new HashMap<>();
for (FilePath file : files) {
CvsConnectionSettings cvsConnectionSettings = CvsUtil.getCvsConnectionSettings(file);
if (!envToFiles.containsKey(cvsConnectionSettings))
envToFiles.put(cvsConnectionSettings, new ArrayList<>());
envToFiles.get(cvsConnectionSettings).add(file.getIOFile());
}
ArrayList<RTagOperation> result = new ArrayList<>();
for (CvsEnvironment cvsEnvironment : envToFiles.keySet()) {
RTagOperation rTagOperation = new RTagOperation(cvsEnvironment, tagName, overrideExisting);
result.add(rTagOperation);
List<File> iofiles = envToFiles.get(cvsEnvironment);
for (File file : iofiles) {
rTagOperation.addFile(file);
}
}
return result.toArray(new RTagOperation[result.size()]);
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class CvsServicesImpl method createCvsVersionOn.
private static ComparableVcsRevisionOnOperation createCvsVersionOn(CvsModule module, Project project) {
final CvsRootConfiguration rootConfiguration = CvsApplicationLevelConfiguration.getInstance().getConfigurationForCvsRoot(module.getRepository().getStringRepresentation());
CvsConnectionSettings env = new IDEARootFormatter(rootConfiguration).createConfiguration();
GetFileContentOperation operation = new GetFileContentOperation(new File(module.getPathInCvs()), env, new SimpleRevision(module.getRevision()));
return new ComparableVcsRevisionOnOperation(operation, project);
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class CvsDiffProvider method createFileContent.
public ContentRevision createFileContent(final VcsRevisionNumber revisionNumber, VirtualFile selectedFile) {
if ((revisionNumber instanceof CvsRevisionNumber)) {
final CvsConnectionSettings settings = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(selectedFile.getParent());
final File file = new File(CvsUtil.getModuleName(selectedFile));
final CvsRevisionNumber cvsRevisionNumber = ((CvsRevisionNumber) revisionNumber);
final RevisionOrDate versionInfo;
if (cvsRevisionNumber.getDateOrRevision() != null) {
versionInfo = RevisionOrDateImpl.createOn(cvsRevisionNumber.getDateOrRevision());
} else {
versionInfo = new SimpleRevision(cvsRevisionNumber.asString());
}
if (selectedFile.getFileType().isBinary()) {
return new CvsBinaryContentRevision(file, file, versionInfo, settings, myProject);
} else {
return new CvsContentRevision(file, file, versionInfo, settings, myProject);
}
} else {
return null;
}
}
Aggregations