use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class CvsRootOnFileSystem method createMeOn.
public static CvsRootOnFileSystem createMeOn(File file) throws CannotFindCvsRootException {
File nearestRoot = getRootFor(file);
if (nearestRoot == null)
throw new CannotFindCvsRootException(file);
CvsConnectionSettings cvsRoot = getCvsRootFor(nearestRoot);
if (cvsRoot == CvsInfo.getAbsentSettings())
throw new CannotFindCvsRootException(file);
File commonRoot = getCommonRoot(nearestRoot, cvsRoot);
return new CvsRootOnFileSystem(getCvsEntriesManager().getCvsConnectionSettingsFor(commonRoot), commonRoot);
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class CvsAnnotationProvider method annotate.
public FileAnnotation annotate(VirtualFile virtualFile) throws VcsException {
final File file = new File(virtualFile.getPath());
final File cvsLightweightFile = CvsUtil.getCvsLightweightFileForFile(file);
final String revision = CvsUtil.getRevisionFor(file);
final CvsEntriesManager entriesManager = CvsEntriesManager.getInstance();
final CvsConnectionSettings root = entriesManager.getCvsConnectionSettingsFor(file.getParentFile());
final boolean binary = annotateBinary(virtualFile, root);
final AnnotateOperation operation = executeOperation(cvsLightweightFile, revision, root, binary, true);
final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(virtualFile);
final List<VcsFileRevision> revisions = myCvsHistoryProvider.createRevisions(filePath);
final Annotation[] lineAnnotations = operation.getLineAnnotations();
adjustAnnotation(revisions, lineAnnotations);
return new CvsFileAnnotation(operation.getContent(), lineAnnotations, revisions, virtualFile, revision, myProject);
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class ToggleOfflineAction method setSelected.
public void setSelected(AnActionEvent e, boolean state) {
CvsContext cvsContext = CvsContextWrapper.createInstance(e);
final CvsEntriesManager entriesManager = CvsEntriesManager.getInstance();
final VirtualFile file = cvsContext.getSelectedFile();
if (file == null)
return;
final VirtualFile firstDirInChain = file.isDirectory() ? file : file.getParent();
if (firstDirInChain == null)
return;
CvsConnectionSettings settings = entriesManager.getCvsConnectionSettingsFor(firstDirInChain);
if (!settings.isValid()) {
entriesManager.clearCachedEntriesFor(firstDirInChain);
settings = entriesManager.getCvsConnectionSettingsFor(firstDirInChain);
}
if ((settings != null) && settings.isValid() && (state != settings.isOffline())) {
VcsBalloonProblemNotifier.showOverChangesView(cvsContext.getProject(), state ? CvsBundle.message("set.offline.notification.text") : CvsBundle.message("set.online.notification.text"), state ? MessageType.WARNING : MessageType.INFO);
settings.setOffline(state);
}
}
use of com.intellij.cvsSupport2.connections.CvsConnectionSettings in project intellij-community by JetBrains.
the class ToggleOfflineAction method isSelected.
public boolean isSelected(AnActionEvent e) {
CvsContext cvsContext = CvsContextWrapper.createInstance(e);
if (!cvsContext.cvsIsActive())
return false;
VirtualFile root = cvsContext.getSelectedFile();
if (root == null)
return false;
final VirtualFile firstDirInChain = root.isDirectory() ? root : root.getParent();
if (firstDirInChain == null)
return false;
CvsConnectionSettings settings = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(firstDirInChain);
if (settings == null)
return false;
return settings.isOffline();
}
Aggregations