Search in sources :

Example 1 with CvsBinaryContentRevision

use of com.intellij.cvsSupport2.changeBrowser.CvsBinaryContentRevision 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

CvsBinaryContentRevision (com.intellij.cvsSupport2.changeBrowser.CvsBinaryContentRevision)1 CvsContentRevision (com.intellij.cvsSupport2.changeBrowser.CvsContentRevision)1 CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)1 RevisionOrDate (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate)1 SimpleRevision (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)1 CvsRevisionNumber (com.intellij.cvsSupport2.history.CvsRevisionNumber)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1