Search in sources :

Example 11 with RootEntry

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

the class ChangeListTest method testRevertionUpToExclusively.

@Test
public void testRevertionUpToExclusively() {
    addChangeSet(facade, "1", createFile(r, "file1"));
    addChangeSet(facade, "2", createFile(r, "file2"));
    RootEntry copy = r.copy();
    facade.revertUpTo(copy, "", facade.getChangeListInTests().getChangesInTests().get(0), null, false, true);
    assertTrue(copy.hasEntry("file1"));
    assertTrue(copy.hasEntry("file2"));
    copy = r.copy();
    facade.revertUpTo(copy, "", facade.getChangeListInTests().getChangesInTests().get(1), null, false, true);
    assertTrue(copy.hasEntry("file1"));
    assertFalse(copy.hasEntry("file2"));
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) Test(org.junit.Test)

Example 12 with RootEntry

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

the class RevisionsTest method testAfterRevisionForRootEntry.

@Test
public void testAfterRevisionForRootEntry() {
    RootEntry root = new RootEntry();
    LocalHistoryFacade facade = new InMemoryLocalHistoryFacade();
    ChangeSet cs = addChangeSet(facade, createFile(root, "f1"));
    addChangeSet(facade, createFile(root, "f2"));
    Revision r = new ChangeRevision(facade, root, "", cs, false);
    RootEntry e = (RootEntry) r.findEntry();
    assertEquals(e.getClass(), RootEntry.class);
    assertNotNull(e.findEntry("f1"));
    assertNull(e.findEntry("f2"));
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) InMemoryLocalHistoryFacade(com.intellij.history.core.InMemoryLocalHistoryFacade) LocalHistoryFacade(com.intellij.history.core.LocalHistoryFacade) InMemoryLocalHistoryFacade(com.intellij.history.core.InMemoryLocalHistoryFacade) ChangeSet(com.intellij.history.core.changes.ChangeSet) Test(org.junit.Test)

Example 13 with RootEntry

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

the class IdeaGateway method createTransientRootEntry.

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

Example 14 with RootEntry

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

the class ContentChange method revertOn.

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

Example 15 with RootEntry

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

the class MoveChange method revertOn.

@Override
public void revertOn(RootEntry root, boolean warnOnFileNotFound) {
    Entry e = root.findEntry(myPath);
    if (e == null) {
        cannotRevert(myPath, warnOnFileNotFound);
        return;
    }
    removeEntry(e);
    Entry oldParent = root.findEntry(getOldParent());
    if (oldParent == null) {
        cannotRevert(getOldParent(), warnOnFileNotFound);
        return;
    }
    oldParent.addChild(e);
}
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