Search in sources :

Example 1 with RootEntry

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

the class IdeaGateway method createTransientRootEntryForPathOnly.

@NotNull
public RootEntry createTransientRootEntryForPathOnly(@NotNull String path) {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    RootEntry root = new RootEntry();
    doCreateChildrenForPathOnly(root, path, getLocalRoots());
    return root;
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with RootEntry

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

the class LocalHistoryFacade method getByteContentBefore.

private ByteContent getByteContentBefore(RootEntry root, String path, Change change) {
    root = root.copy();
    String newPath = revertUpTo(root, path, null, change, false, false);
    Entry entry = root.findEntry(newPath);
    if (entry == null)
        return new ByteContent(false, null);
    if (entry.isDirectory())
        return new ByteContent(true, null);
    return new ByteContent(false, entry.getContent().getBytesIfAvailable());
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) Entry(com.intellij.history.core.tree.Entry) ByteContent(com.intellij.history.ByteContent)

Example 3 with RootEntry

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

the class CreateEntryChange method revertOn.

@Override
public void revertOn(RootEntry root, boolean warnOnFileNotFound) {
    Entry e = root.findEntry(myPath);
    if (e == null) {
        cannotRevert(myPath, warnOnFileNotFound);
        return;
    }
    removeEntry(e);
}
Also used : Entry(com.intellij.history.core.tree.Entry) RootEntry(com.intellij.history.core.tree.RootEntry)

Example 4 with RootEntry

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

the class DeleteChange method revertOn.

@Override
public void revertOn(RootEntry root, boolean warnOnFileNotFound) {
    String parentPath = Paths.getParentOf(myPath);
    Entry parent = root.findEntry(parentPath);
    if (parent == null) {
        cannotRevert(parentPath, warnOnFileNotFound);
        return;
    }
    parent.addChild(myDeletedEntry.copy());
}
Also used : Entry(com.intellij.history.core.tree.Entry) RootEntry(com.intellij.history.core.tree.RootEntry)

Example 5 with RootEntry

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

the class RenameChange method revertOn.

@Override
public void revertOn(RootEntry root, boolean warnOnFileNotFound) {
    Entry e = root.findEntry(myPath);
    if (e == null) {
        cannotRevert(myPath, warnOnFileNotFound);
        return;
    }
    e.setName(myOldName);
}
Also used : Entry(com.intellij.history.core.tree.Entry) RootEntry(com.intellij.history.core.tree.RootEntry)

Aggregations

RootEntry (com.intellij.history.core.tree.RootEntry)22 Entry (com.intellij.history.core.tree.Entry)13 FileEntry (com.intellij.history.core.tree.FileEntry)6 Test (org.junit.Test)6 NotNull (org.jetbrains.annotations.NotNull)2 ByteContent (com.intellij.history.ByteContent)1 InMemoryLocalHistoryFacade (com.intellij.history.core.InMemoryLocalHistoryFacade)1 LocalHistoryFacade (com.intellij.history.core.LocalHistoryFacade)1 ChangeSet (com.intellij.history.core.changes.ChangeSet)1 DirectoryEntry (com.intellij.history.core.tree.DirectoryEntry)1