Search in sources :

Example 1 with Reverter

use of com.intellij.history.integration.revertion.Reverter in project intellij-community by JetBrains.

the class RecentChangeDialogTest method testRevertChange.

public void testRevertChange() throws IOException {
    getVcs().beginChangeSet();
    createChildData(myRoot, "f1.txt");
    getVcs().endChangeSet("change");
    getVcs().beginChangeSet();
    createChildData(myRoot, "f2.txt");
    getVcs().endChangeSet("another change");
    RecentChange c = getVcs().getRecentChanges(getRootEntry()).get(1);
    RecentChangeDialogModel m = new RecentChangeDialogModel(myProject, myGateway, getVcs(), c);
    Reverter r = m.createReverter();
    r.revert();
    assertNull(myRoot.findChild("f1.txt"));
    assertNotNull(myRoot.findChild("f2.txt"));
}
Also used : RecentChange(com.intellij.history.core.revisions.RecentChange) Reverter(com.intellij.history.integration.revertion.Reverter) RecentChangeDialogModel(com.intellij.history.integration.ui.models.RecentChangeDialogModel)

Example 2 with Reverter

use of com.intellij.history.integration.revertion.Reverter in project intellij-community by JetBrains.

the class SelectionHistoryDialogTest method testRevert.

public void testRevert() throws IOException {
    initModelOnSecondLineAndSelectRevisions(0, 0);
    Reverter r = m.createReverter();
    r.revert();
    assertEquals("a\nbc\nc\ne\n", new String(f.contentsToByteArray()));
}
Also used : Reverter(com.intellij.history.integration.revertion.Reverter)

Aggregations

Reverter (com.intellij.history.integration.revertion.Reverter)2 RecentChange (com.intellij.history.core.revisions.RecentChange)1 RecentChangeDialogModel (com.intellij.history.integration.ui.models.RecentChangeDialogModel)1