Search in sources :

Example 26 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class LocalHistoryTestCase method delete.

public DeleteChange delete(RootEntry root, String path) {
    Entry e = root.getEntry(path);
    e.getParent().removeChild(e);
    return new DeleteChange(nextId(), path, e);
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) FileEntry(com.intellij.history.core.tree.FileEntry) Entry(com.intellij.history.core.tree.Entry)

Example 27 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class LocalHistoryTestCase method rename.

public RenameChange rename(RootEntry root, String path, String newName) {
    Entry e = root.getEntry(path);
    RenameChange result = new RenameChange(nextId(), Paths.renamed(path, newName), e.getName());
    e.setName(newName);
    return result;
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) FileEntry(com.intellij.history.core.tree.FileEntry) Entry(com.intellij.history.core.tree.Entry)

Example 28 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class LocalHistoryTestCase method changeContent.

public ContentChange changeContent(RootEntry root, String path, String content, long timestamp) {
    Entry e = root.getEntry(path);
    ContentChange result = new ContentChange(nextId(), path, e.getContent(), e.getTimestamp());
    e.setContent(c(content), timestamp);
    return result;
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) FileEntry(com.intellij.history.core.tree.FileEntry) Entry(com.intellij.history.core.tree.Entry)

Example 29 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class SelectionCalculator method getRevisionContent.

@Nullable
private String getRevisionContent(Revision r) {
    Entry e = r.findEntry();
    if (e == null)
        return null;
    Content c = e.getContent();
    if (!c.isAvailable())
        throw new ContentIsUnavailableException();
    return c.getString(e, myGateway);
}
Also used : Entry(com.intellij.history.core.tree.Entry) Content(com.intellij.history.core.Content) Nullable(org.jetbrains.annotations.Nullable)

Example 30 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class SelectionReverterTest method createReverter.

private SelectionReverter createReverter(int from, int to) {
    List<Revision> rr = getRevisionsFor(f);
    SelectionCalculator c = new SelectionCalculator(myGateway, rr, from, to);
    Revision leftRev = rr.get(1);
    Entry entry = getRootEntry().getEntry(f.getPath());
    return new SelectionReverter(myProject, getVcs(), myGateway, c, leftRev, entry, from, to);
}
Also used : Entry(com.intellij.history.core.tree.Entry) Revision(com.intellij.history.core.revisions.Revision) SelectionCalculator(com.intellij.history.integration.ui.models.SelectionCalculator)

Aggregations

Entry (com.intellij.history.core.tree.Entry)37 RootEntry (com.intellij.history.core.tree.RootEntry)25 FileEntry (com.intellij.history.core.tree.FileEntry)12 Test (org.junit.Test)12 DirectoryEntry (com.intellij.history.core.tree.DirectoryEntry)11 VirtualFile (com.intellij.openapi.vfs.VirtualFile)7 Revision (com.intellij.history.core.revisions.Revision)5 StoredContent (com.intellij.history.core.StoredContent)4 Difference (com.intellij.history.core.revisions.Difference)3 NewVirtualFile (com.intellij.openapi.vfs.newvfs.NewVirtualFile)2 ByteContent (com.intellij.history.ByteContent)1 Content (com.intellij.history.core.Content)1 Change (com.intellij.history.core.changes.Change)1 DeleteChange (com.intellij.history.core.changes.DeleteChange)1 StructuralChange (com.intellij.history.core.changes.StructuralChange)1 SelectionCalculator (com.intellij.history.integration.ui.models.SelectionCalculator)1 VirtualFileSystemEntry (com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry)1 THashSet (gnu.trove.THashSet)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1