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