use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testDoesNotIncludeRevisionsForAnotherEntries.
public void testDoesNotIncludeRevisionsForAnotherEntries() throws IOException {
getVcs().beginChangeSet();
createFile("file1.txt");
getVcs().endChangeSet("1");
getVcs().beginChangeSet();
VirtualFile f2 = createFile("file2.txt");
getVcs().endChangeSet("2");
List<Revision> rr = getRevisionsFor(f2);
assertEquals(2, rr.size());
assertEquals("2", rr.get(1).getChangeSetName());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testRevisionForDirectoryWithTheSameNameAsDeletedOne.
public void testRevisionForDirectoryWithTheSameNameAsDeletedOne() throws IOException {
VirtualFile dir = createDirectory("dir");
delete(dir);
dir = createDirectory("dir");
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 testDoesNotIncludeNotModifiedDifferences.
public void testDoesNotIncludeNotModifiedDifferences() throws IOException {
getVcs().beginChangeSet();
VirtualFile dir = createDirectory("dir1");
createFile("dir1/dir2/file.txt");
createDirectory("dir1/dir3");
getVcs().endChangeSet(null);
createFile("dir1/dir3/file.txt");
List<Revision> rr = getRevisionsFor(dir);
Revision recent = rr.get(0);
Revision prev = rr.get(1);
List<Difference> dd = prev.getDifferencesWith(recent);
assertEquals(1, dd.size());
Difference d = dd.get(0);
assertNull(d.getLeft());
assertEquals(myRoot.getPath() + "/dir1/dir3/file.txt", d.getRight().getPath());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testGettingDifferenceBetweenRevisions.
public void testGettingDifferenceBetweenRevisions() throws IOException {
VirtualFile f = createFile("file.txt", "one");
loadContent(f);
setContent(f, "two");
List<Revision> rr = getRevisionsFor(f);
Revision recent = rr.get(0);
Revision prev = rr.get(1);
List<Difference> dd = prev.getDifferencesWith(recent);
assertEquals(1, dd.size());
Difference d = dd.get(0);
assertContent("one", d.getLeft());
assertContent("two", d.getRight());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class RevisionsAndDiffsTest method testGettingEntryFromRevisionInRenamedDir.
public void testGettingEntryFromRevisionInRenamedDir() throws IOException {
VirtualFile dir = createDirectory("dir");
VirtualFile f = createFile("dir/file.txt");
rename(dir, "newDir");
setContent(f, "xxx");
List<Revision> rr = getRevisionsFor(f);
assertEquals(4, rr.size());
assertEquals(myRoot.getPath() + "/newDir/file.txt", rr.get(0).findEntry().getPath());
assertEquals(myRoot.getPath() + "/newDir/file.txt", rr.get(1).findEntry().getPath());
assertEquals(myRoot.getPath() + "/dir/file.txt", rr.get(2).findEntry().getPath());
}
Aggregations