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);
}
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);
}
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;
}
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;
}
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"));
}
Aggregations