use of com.intellij.openapi.vcs.history.VcsRevisionNumber in project intellij-community by JetBrains.
the class CvsChangeProvider method processFile.
private void processFile(final FilePath filePath, final ChangelistBuilder builder, final ProgressIndicator progress) throws VcsException {
final VirtualFile dir = filePath.getVirtualFileParent();
if (dir == null)
return;
final Entry entry = myEntriesManager.getEntryFor(dir, filePath.getName());
final FileStatus status = CvsStatusProvider.getStatus(filePath.getVirtualFile(), entry);
final VcsRevisionNumber number = entry != null ? createRevisionNumber(entry.getRevision(), status) : VcsRevisionNumber.NULL;
processStatus(filePath, dir.findChild(filePath.getName()), status, number, builder);
progress.checkCanceled();
checkSwitchedFile(filePath, builder, dir, entry);
}
use of com.intellij.openapi.vcs.history.VcsRevisionNumber in project intellij-community by JetBrains.
the class AnnotateVcsVirtualFileAction method extractData.
@Nullable
private static AnnotationData extractData(@NotNull Project project, @NotNull VirtualFile file) {
FilePath filePath = null;
VcsRevisionNumber revisionNumber = null;
if (file instanceof VcsVirtualFile) {
filePath = VcsUtil.getFilePath(file.getPath());
VcsFileRevision revision = ((VcsVirtualFile) file).getFileRevision();
revisionNumber = revision != null ? revision.getRevisionNumber() : null;
} else if (file instanceof ContentRevisionVirtualFile) {
ContentRevision revision = ((ContentRevisionVirtualFile) file).getContentRevision();
filePath = revision.getFile();
revisionNumber = revision.getRevisionNumber();
}
if (filePath == null || revisionNumber == null)
return null;
AbstractVcs vcs = VcsUtil.getVcsFor(project, filePath);
return vcs != null ? new AnnotationData(vcs, filePath, revisionNumber) : null;
}
use of com.intellij.openapi.vcs.history.VcsRevisionNumber in project intellij-community by JetBrains.
the class AnnotationFieldGutter method getBgColor.
@Nullable
@Override
public Color getBgColor(int line, Editor editor) {
if (myColorScheme == null)
return null;
ColorMode type = ShowAnnotationColorsAction.getType();
Map<VcsRevisionNumber, Color> colorMap = type == ColorMode.AUTHOR ? myColorScheme.second : myColorScheme.first;
if (colorMap == null || type == ColorMode.NONE)
return null;
final VcsRevisionNumber number = myAnnotation.getLineRevisionNumber(line);
if (number == null)
return null;
return colorMap.get(number);
}
use of com.intellij.openapi.vcs.history.VcsRevisionNumber in project intellij-community by JetBrains.
the class AnnotationPresentation method getFontType.
@Override
public EditorFontType getFontType(final int line) {
VcsRevisionNumber revision = myFileAnnotation.originalRevision(line);
VcsRevisionNumber currentRevision = myFileAnnotation.getCurrentRevision();
return currentRevision != null && currentRevision.equals(revision) ? EditorFontType.BOLD : EditorFontType.PLAIN;
}
use of com.intellij.openapi.vcs.history.VcsRevisionNumber in project intellij-community by JetBrains.
the class CopyRevisionNumberFromAnnotateAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
if (myLineNumber < 0)
return;
final VcsRevisionNumber revisionNumber = myAnnotation.getLineRevisionNumber(myLineNumber);
if (revisionNumber != null) {
final String revision = revisionNumber.asString();
CopyPasteManager.getInstance().setContents(new TextTransferable(revision));
}
}
Aggregations