use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testNoDifferenceForDirectoryWithEqualContents.
public void testNoDifferenceForDirectoryWithEqualContents() throws IOException {
VirtualFile dir = createDirectory("dir");
VirtualFile f = createFile("dir/file.txt");
delete(f);
List<Revision> rr = getRevisionsFor(dir);
assertTrue(rr.get(0).getDifferencesWith(rr.get(2)).isEmpty());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testRevisionsIfSomeFilesWereDeletedDuringChangeSet.
public void testRevisionsIfSomeFilesWereDeletedDuringChangeSet() throws IOException {
VirtualFile dir = createDirectory("dir");
VirtualFile f = createFile("dir/f.txt");
getVcs().beginChangeSet();
delete(f);
List<Revision> rr = getRevisionsFor(dir);
assertEquals(4, rr.size());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testIncludingCurrentVersionIntoRevisionsAfterPurge.
public void testIncludingCurrentVersionIntoRevisionsAfterPurge() throws Exception {
Clock.setTime(10);
VirtualFile f = createFile("file.txt", "content");
loadContent(f);
getVcs().getChangeListInTests().purgeObsolete(0);
List<Revision> rr = getRevisionsFor(f);
assertEquals(1, rr.size());
Revision r = rr.get(0);
assertNull(r.getLabel());
assertNull(r.getChangeSetName());
assertEquals(f.getTimeStamp(), r.getTimestamp());
Entry e = r.findEntry();
assertEquals("file.txt", e.getName());
assertContent("content", e);
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testRevisionsForFileThatWasCreatedAndDeletedInOneChangeSet.
public void testRevisionsForFileThatWasCreatedAndDeletedInOneChangeSet() throws IOException {
getVcs().beginChangeSet();
VirtualFile f = createFile("f.txt");
getVcs().endChangeSet("1");
delete(f);
getVcs().beginChangeSet();
f = createFile("f.txt");
delete(f);
getVcs().endChangeSet("2");
getVcs().beginChangeSet();
f = createFile("f.txt");
getVcs().endChangeSet("3");
getVcs().beginChangeSet();
delete(f);
f = createFile("f.txt");
getVcs().endChangeSet("4");
List<Revision> rr = getRevisionsFor(f);
assertEquals(6, rr.size());
assertEquals("4", rr.get(1).getChangeSetName());
assertEquals("3", rr.get(2).getChangeSetName());
assertEquals("2", rr.get(3).getChangeSetName());
assertEquals(null, rr.get(4).getChangeSetName());
assertEquals("1", rr.get(5).getChangeSetName());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testTimestampForLastRevisionAfterPurge.
public void testTimestampForLastRevisionAfterPurge() throws IOException {
Clock.setTime(10);
VirtualFile f = createFile("file1.txt");
Clock.setTime(20);
setContent(f, "a");
Clock.setTime(30);
setContent(f, "b");
getVcs().getChangeListInTests().purgeObsolete(15);
List<Revision> rr = getRevisionsFor(f);
assertEquals(30L, rr.get(1).getTimestamp());
assertEquals(20L, rr.get(2).getTimestamp());
}
Aggregations