Search in sources :

Example 1 with CvsConnectionSettings

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);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CvsConnectionSettings(com.intellij.cvsSupport2.connections.CvsConnectionSettings) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with CvsConnectionSettings

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);
}
Also used : CvsConnectionSettings(com.intellij.cvsSupport2.connections.CvsConnectionSettings) CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration) IDEARootFormatter(com.intellij.cvsSupport2.connections.IDEARootFormatter)

Example 3 with CvsConnectionSettings

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()]);
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) HashMap(com.intellij.util.containers.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CvsEnvironment(com.intellij.cvsSupport2.connections.CvsEnvironment) CvsConnectionSettings(com.intellij.cvsSupport2.connections.CvsConnectionSettings) File(java.io.File)

Example 4 with CvsConnectionSettings

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);
}
Also used : GetFileContentOperation(com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation) CvsConnectionSettings(com.intellij.cvsSupport2.connections.CvsConnectionSettings) ComparableVcsRevisionOnOperation(com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation) File(java.io.File) VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile) CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration) IDEARootFormatter(com.intellij.cvsSupport2.connections.IDEARootFormatter) SimpleRevision(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)

Example 5 with CvsConnectionSettings

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;
    }
}
Also used : CvsContentRevision(com.intellij.cvsSupport2.changeBrowser.CvsContentRevision) CvsConnectionSettings(com.intellij.cvsSupport2.connections.CvsConnectionSettings) CvsBinaryContentRevision(com.intellij.cvsSupport2.changeBrowser.CvsBinaryContentRevision) RevisionOrDate(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) CvsRevisionNumber(com.intellij.cvsSupport2.history.CvsRevisionNumber) SimpleRevision(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)

Aggregations

CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)8 File (java.io.File)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 CvsContext (com.intellij.cvsSupport2.actions.cvsContext.CvsContext)2 CvsEntriesManager (com.intellij.cvsSupport2.application.CvsEntriesManager)2 CvsRootConfiguration (com.intellij.cvsSupport2.config.CvsRootConfiguration)2 IDEARootFormatter (com.intellij.cvsSupport2.connections.IDEARootFormatter)2 SimpleRevision (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)2 FilePath (com.intellij.openapi.vcs.FilePath)2 CvsBinaryContentRevision (com.intellij.cvsSupport2.changeBrowser.CvsBinaryContentRevision)1 CvsContentRevision (com.intellij.cvsSupport2.changeBrowser.CvsContentRevision)1 CvsEnvironment (com.intellij.cvsSupport2.connections.CvsEnvironment)1 AnnotateOperation (com.intellij.cvsSupport2.cvsoperations.cvsAnnotate.AnnotateOperation)1 Annotation (com.intellij.cvsSupport2.cvsoperations.cvsAnnotate.Annotation)1 GetFileContentOperation (com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation)1 RevisionOrDate (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate)1 CannotFindCvsRootException (com.intellij.cvsSupport2.errorHandling.CannotFindCvsRootException)1 ComparableVcsRevisionOnOperation (com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation)1 CvsRevisionNumber (com.intellij.cvsSupport2.history.CvsRevisionNumber)1 FileAnnotation (com.intellij.openapi.vcs.annotate.FileAnnotation)1