use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class LocalHistoryEventDispatcher method beforeFileDeletion.
@Override
public void beforeFileDeletion(@NotNull VirtualFileEvent e) {
VirtualFile f = e.getFile();
Entry entry = myGateway.createEntryForDeletion(f);
if (entry != null) {
myVcs.deleted(f.getPath(), entry);
}
}
use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.
the class DifferenceReverter method doRevert.
public void doRevert(boolean revertContentChanges) throws IOException {
Set<String> vetoedFiles = new THashSet<>();
for (Difference each : ContainerUtil.iterateBackward(myDiffs)) {
Entry l = each.getLeft();
Entry r = each.getRight();
if (l == null) {
revertCreation(r, vetoedFiles);
continue;
}
vetoedFiles.add(l.getPath());
if (r == null) {
revertDeletion(l);
continue;
}
VirtualFile file = myGateway.findOrCreateFileSafely(r.getPath(), r.isDirectory());
revertRename(l, file);
if (revertContentChanges)
revertContentChange(l, file);
}
}
use of com.intellij.history.core.tree.Entry 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.Entry 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);
}
use of com.intellij.history.core.tree.Entry 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);
}
Aggregations