Search in sources :

Example 26 with VcsRevisionNumber

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);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VirtualFileEntry(com.intellij.cvsSupport2.checkinProject.VirtualFileEntry) Entry(org.netbeans.lib.cvsclient.admin.Entry) VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber)

Example 27 with VcsRevisionNumber

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;
}
Also used : VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile) VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber) ContentRevision(com.intellij.openapi.vcs.changes.ContentRevision) VcsFileRevision(com.intellij.openapi.vcs.history.VcsFileRevision) ContentRevisionVirtualFile(com.intellij.openapi.vcs.vfs.ContentRevisionVirtualFile) Nullable(org.jetbrains.annotations.Nullable)

Example 28 with VcsRevisionNumber

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);
}
Also used : VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber) Nullable(org.jetbrains.annotations.Nullable)

Example 29 with VcsRevisionNumber

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;
}
Also used : VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber)

Example 30 with VcsRevisionNumber

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));
    }
}
Also used : TextTransferable(com.intellij.util.ui.TextTransferable) VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber)

Aggregations

VcsRevisionNumber (com.intellij.openapi.vcs.history.VcsRevisionNumber)48 VirtualFile (com.intellij.openapi.vfs.VirtualFile)14 Nullable (org.jetbrains.annotations.Nullable)12 NotNull (org.jetbrains.annotations.NotNull)11 VcsFileRevision (com.intellij.openapi.vcs.history.VcsFileRevision)7 FilePath (com.intellij.openapi.vcs.FilePath)6 Project (com.intellij.openapi.project.Project)5 VcsException (com.intellij.openapi.vcs.VcsException)4 File (java.io.File)4 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)3 Pair (com.intellij.openapi.util.Pair)3 AbstractVcs (com.intellij.openapi.vcs.AbstractVcs)3 VcsRoot (com.intellij.openapi.vcs.VcsRoot)3 Change (com.intellij.openapi.vcs.changes.Change)3 VcsVirtualFile (com.intellij.openapi.vcs.vfs.VcsVirtualFile)3 HashMap (com.intellij.util.containers.HashMap)3 DiffContent (com.intellij.diff.contents.DiffContent)2 Logger (com.intellij.openapi.diagnostic.Logger)2 Document (com.intellij.openapi.editor.Document)2 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)2