use of com.intellij.history.core.Content in project intellij-community by JetBrains.
the class SelectionCalculator method getRevisionContent.
@Nullable
private String getRevisionContent(Revision r) {
Entry e = r.findEntry();
if (e == null)
return null;
Content c = e.getContent();
if (!c.isAvailable())
throw new ContentIsUnavailableException();
return c.getString(e, myGateway);
}
use of com.intellij.history.core.Content in project intellij-community by JetBrains.
the class DifferenceReverter method setContent.
private void setContent(Entry l, VirtualFile file) throws IOException {
Content c = l.getContent();
if (!c.isAvailable())
return;
file.setBinaryContent(c.getBytes(), -1, l.getTimestamp());
}
use of com.intellij.history.core.Content in project intellij-community by JetBrains.
the class DirectoryEntryTest method testCaseInsensitiveChildrenDiffProcessing.
@Test
public void testCaseInsensitiveChildrenDiffProcessing() {
DirectoryEntry e1 = new DirectoryEntry("dir");
Content content = c("content");
final String name = "name";
final String name_v2 = "NAME";
final String name2 = "Name2";
final String name2_v2 = "name2";
e1.addChild(new FileEntry(name, content, -1, false));
e1.addChild(new FileEntry(name2, content, -1, false));
DirectoryEntry e2 = new DirectoryEntry("dir");
e2.addChild(new FileEntry(name_v2, content, -1, false));
e2.addChild(new FileEntry(name2_v2, content, -1, false));
try {
Paths.setCaseSensitive(false);
List<Difference> differences = Entry.getDifferencesBetween(e1, e2);
assertEquals(2, differences.size());
assertEquals(name, differences.get(0).getLeft().getName());
assertEquals(name_v2, differences.get(0).getRight().getName());
assertEquals(name2, differences.get(1).getLeft().getName());
assertEquals(name2_v2, differences.get(1).getRight().getName());
} finally {
Paths.useSystemCaseSensitivity();
}
}
Aggregations