Search in sources :

Example 1 with ComparableVcsRevisionOnOperation

use of com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation in project intellij-community by JetBrains.

the class CvsServicesImpl method openInEditor.

public void openInEditor(Project project, CvsModule cvsFile) {
    CvsRepository repository = cvsFile.getRepository();
    RevisionOrDate revisionOrDate = RevisionOrDateImpl.createOn(new DateOrRevisionSettings().updateFrom(repository.getDateOrRevision()));
    GetFileContentOperation operation = new GetFileContentOperation(new File(cvsFile.getPathInCvs()), CvsRootConfiguration.createOn(repository), revisionOrDate);
    ComparableVcsRevisionOnOperation revision = new ComparableVcsRevisionOnOperation(operation, project);
    VcsVirtualFile vcsVirtualFile = new VcsVirtualFile(cvsFile.getPathInCvs(), revision, VcsFileSystem.getInstance());
    OpenFileDescriptor openFileDescriptor = new OpenFileDescriptor(project, vcsVirtualFile);
    FileEditorManager.getInstance(project).openTextEditor(openFileDescriptor, false);
}
Also used : GetFileContentOperation(com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation) DateOrRevisionSettings(com.intellij.cvsSupport2.config.DateOrRevisionSettings) VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile) OpenFileDescriptor(com.intellij.openapi.fileEditor.OpenFileDescriptor) CvsRepository(com.intellij.openapi.cvsIntegration.CvsRepository) ComparableVcsRevisionOnOperation(com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation) RevisionOrDate(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate) File(java.io.File) VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile)

Example 2 with ComparableVcsRevisionOnOperation

use of com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation 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)

Aggregations

GetFileContentOperation (com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation)2 ComparableVcsRevisionOnOperation (com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation)2 VcsVirtualFile (com.intellij.openapi.vcs.vfs.VcsVirtualFile)2 File (java.io.File)2 CvsRootConfiguration (com.intellij.cvsSupport2.config.CvsRootConfiguration)1 DateOrRevisionSettings (com.intellij.cvsSupport2.config.DateOrRevisionSettings)1 CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)1 IDEARootFormatter (com.intellij.cvsSupport2.connections.IDEARootFormatter)1 RevisionOrDate (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate)1 SimpleRevision (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)1 CvsRepository (com.intellij.openapi.cvsIntegration.CvsRepository)1 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)1