use of com.intellij.history.core.tree.Entry 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());
}
use of com.intellij.history.core.tree.Entry 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);
}
use of com.intellij.history.core.tree.Entry 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;
}
use of com.intellij.history.core.tree.Entry 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;
}
use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class StreamTest method testDirectoryEntryWithChildren.
@Test
public void testDirectoryEntryWithChildren() throws IOException {
Entry dir = new DirectoryEntry("");
Entry subDir = new DirectoryEntry("");
dir.addChild(subDir);
subDir.addChild(new FileEntry("a", new StoredContent(333), -1, false));
subDir.addChild(new FileEntry("b", new StoredContent(333), -1, false));
StreamUtil.writeEntry(os, dir);
Entry result = StreamUtil.readEntry(is);
List<Entry> children = result.getChildren();
assertEquals(1, children.size());
Entry e = children.get(0);
assertEquals(DirectoryEntry.class, e.getClass());
assertSame(result, e.getParent());
children = e.getChildren();
assertEquals(2, children.size());
assertEquals(FileEntry.class, children.get(0).getClass());
assertSame(e, children.get(0).getParent());
assertEquals(FileEntry.class, children.get(1).getClass());
assertSame(e, children.get(1).getParent());
}
Aggregations