Search in sources :

Example 16 with RootEntry

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

the class ROStatusChange method revertOn.

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

Example 17 with RootEntry

use of com.intellij.history.core.tree.RootEntry 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 18 with RootEntry

use of com.intellij.history.core.tree.RootEntry 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 19 with RootEntry

use of com.intellij.history.core.tree.RootEntry 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 20 with RootEntry

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

the class ChangeListTest method testRevertionUpToWithTrackingPath.

@Test
public void testRevertionUpToWithTrackingPath() {
    add(facade, createFile(r, "file1"));
    add(facade, createFile(r, "file2"));
    add(facade, rename(r, "file2", "file3"));
    RootEntry copy = r.copy();
    assertEquals("file3", facade.revertUpTo(copy, "file3", facade.getChangeListInTests().getChangesInTests().get(0), null, false, true));
    assertTrue(copy.hasEntry("file1"));
    assertFalse(copy.hasEntry("file2"));
    assertTrue(copy.hasEntry("file3"));
    copy = r.copy();
    assertEquals("file2", facade.revertUpTo(copy, "file3", facade.getChangeListInTests().getChangesInTests().get(1), null, false, true));
    assertTrue(copy.hasEntry("file1"));
    assertTrue(copy.hasEntry("file2"));
    assertFalse(copy.hasEntry("file3"));
    copy = r.copy();
    assertEquals("file2", facade.revertUpTo(copy, "file3", facade.getChangeListInTests().getChangesInTests().get(1), null, true, true));
    assertTrue(copy.hasEntry("file1"));
    assertFalse(copy.hasEntry("file2"));
    assertFalse(copy.hasEntry("file3"));
}
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