use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class SelectionReverterTest method testChangeSetName.
public void testChangeSetName() throws IOException {
long time = new Date(2001, 1, 11, 12, 30).getTime();
Clock.setTime(time);
setBinaryContent(f, "one".getBytes());
setBinaryContent(f, "two".getBytes());
revertToPreviousRevision(0, 0);
List<Revision> rr = getRevisionsFor(f);
assertEquals(5, rr.size());
assertEquals("Reverted to " + DateFormatUtil.formatDateTime(time), rr.get(1).getChangeSetName());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class DirectoryChangeModelTest method testNames.
public void testNames() throws IOException {
VirtualFile f = createDirectory("foo");
rename(f, "bar");
List<Revision> revs = getRevisionsFor(f);
Difference d = new Difference(false, revs.get(0).findEntry(), revs.get(1).findEntry());
DirectoryChangeModel m = createModelOn(d);
assertEquals("bar", m.getEntryName(0));
assertEquals("foo", m.getEntryName(1));
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class DirectoryChangeModelTest method testCanShowFileDifference.
public void testCanShowFileDifference() throws IOException {
VirtualFile f = createFile("foo.txt");
setContent(f, "xxx");
List<Revision> revs = getRevisionsFor(f);
Difference d1 = new Difference(true, revs.get(0).findEntry(), revs.get(1).findEntry());
Difference d2 = new Difference(true, null, revs.get(1).findEntry());
Difference d3 = new Difference(true, revs.get(1).findEntry(), null);
assertTrue(createModelOn(d1).canShowFileDifference());
assertTrue(createModelOn(d2).canShowFileDifference());
assertTrue(createModelOn(d3).canShowFileDifference());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class SelectionCalculatorTest method testSelectionWasMoved.
@Test
public void testSelectionWasMoved() throws FilesTooBigForDiffException {
List<Revision> rr = createRevisions("abc\ndef\nghi", "def\nghi");
SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 1);
Block b0 = c.getSelectionFor(rr.get(0), new NullProgress());
Block b1 = c.getSelectionFor(rr.get(1), new NullProgress());
assertBlock(0, 2, "def\nghi", b0);
assertBlock(1, 3, "def\nghi", b1);
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class SelectionCalculatorTest method testSelectionWasNotChanged.
@Test
public void testSelectionWasNotChanged() throws FilesTooBigForDiffException {
List<Revision> rr = createRevisions("abc\ndef\nghi", "abc1\ndef1\nghi1");
SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 2);
Block b0 = c.getSelectionFor(rr.get(0), new NullProgress());
Block b1 = c.getSelectionFor(rr.get(1), new NullProgress());
assertBlock(0, 3, "abc1\ndef1\nghi1", b0);
assertBlock(0, 3, "abc\ndef\nghi", b1);
}
Aggregations