Search in sources :

Example 6 with RootEntry

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

the class ChangeRevision method findEntry.

@Override
public Entry findEntry() {
    RootEntry rootCopy = myRoot.copy();
    boolean revertThis = myBefore;
    String path = myFacade.revertUpTo(rootCopy, myEntryPath, null, myChangeToRevert, revertThis, true);
    return rootCopy.findEntry(path);
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry)

Example 7 with RootEntry

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

the class LocalHistoryTestCase method changeROStatus.

public ROStatusChange changeROStatus(RootEntry root, String path, boolean status) {
    Entry e = root.getEntry(path);
    ROStatusChange result = new ROStatusChange(nextId(), path, e.isReadOnly());
    e.setReadOnly(status);
    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 8 with RootEntry

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

the class LocalHistoryTestCase method move.

public MoveChange move(RootEntry root, String path, String newParent) {
    Entry e = root.getEntry(path);
    MoveChange result = new MoveChange(nextId(), Paths.reparented(path, newParent), e.getParent().getPath());
    e.getParent().removeChild(e);
    root.getEntry(newParent).addChild(e);
    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 9 with RootEntry

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

the class ChangeListTest method testRevertionUpToWithTrackingPathWithDeletionAndMovements.

@Test
public void testRevertionUpToWithTrackingPathWithDeletionAndMovements() {
    add(facade, createDirectory(r, "root"));
    add(facade, createDirectory(r, "root/dir1"));
    add(facade, rename(r, "root/dir1", "dir2"));
    add(facade, delete(r, "root/dir2"));
    add(facade, createDirectory(r, "root/dir2"));
    add(facade, rename(r, "root", "root2"));
    RootEntry copy = r.copy();
    assertEquals("root/dir2", facade.revertUpTo(copy, "root2/dir2", facade.getChangeListInTests().getChangesInTests().get(3), null, false, true));
    assertTrue(copy.hasEntry("root/dir2"));
    assertFalse(copy.hasEntry("root/dir1"));
    assertFalse(copy.hasEntry("root1"));
    copy = r.copy();
    assertEquals("root/dir1", facade.revertUpTo(copy, "root2/dir2", facade.getChangeListInTests().getChangesInTests().get(3), null, true, true));
    assertTrue(copy.hasEntry("root/dir1"));
    assertFalse(copy.hasEntry("root/dir2"));
    assertFalse(copy.hasEntry("root1"));
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) Test(org.junit.Test)

Example 10 with RootEntry

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

the class ChangeListTest method testRevertionUpToInclusively.

@Test
public void testRevertionUpToInclusively() {
    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, true, true);
    assertTrue(copy.hasEntry("file1"));
    assertFalse(copy.hasEntry("file2"));
    copy = r.copy();
    facade.revertUpTo(copy, "", facade.getChangeListInTests().getChangesInTests().get(1), null, true, true);
    assertFalse(copy.hasEntry("file1"));
    assertFalse(copy.hasEntry("file2"));
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) Test(org.junit.Test)

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