use of com.intellij.history.core.tree.RootEntry in project intellij-community by JetBrains.
the class IdeaGateway method createTransientRootEntryForPathOnly.
@NotNull
public RootEntry createTransientRootEntryForPathOnly(@NotNull String path) {
ApplicationManager.getApplication().assertReadAccessAllowed();
RootEntry root = new RootEntry();
doCreateChildrenForPathOnly(root, path, getLocalRoots());
return root;
}
use of com.intellij.history.core.tree.RootEntry in project intellij-community by JetBrains.
the class LocalHistoryFacade method getByteContentBefore.
private ByteContent getByteContentBefore(RootEntry root, String path, Change change) {
root = root.copy();
String newPath = revertUpTo(root, path, null, change, false, false);
Entry entry = root.findEntry(newPath);
if (entry == null)
return new ByteContent(false, null);
if (entry.isDirectory())
return new ByteContent(true, null);
return new ByteContent(false, entry.getContent().getBytesIfAvailable());
}
use of com.intellij.history.core.tree.RootEntry in project intellij-community by JetBrains.
the class CreateEntryChange method revertOn.
@Override
public void revertOn(RootEntry root, boolean warnOnFileNotFound) {
Entry e = root.findEntry(myPath);
if (e == null) {
cannotRevert(myPath, warnOnFileNotFound);
return;
}
removeEntry(e);
}
use of com.intellij.history.core.tree.RootEntry 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.RootEntry 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);
}
Aggregations