use of com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate 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);
}
use of com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate 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