Search in sources :

Example 1 with DirectoryChange

use of com.intellij.history.integration.ui.views.DirectoryChange in project intellij-community by JetBrains.

the class DirectoryHistoryDialogTest method testSelectionRevertion.

public void testSelectionRevertion() throws Exception {
    createChildData(myRoot, "f1.txt");
    createChildData(myRoot, "f2.txt");
    DirectoryHistoryDialogModel m = createModelAndSelectRevision(1);
    DirectoryChange c = (DirectoryChange) m.getChanges().get(0);
    m.createRevisionReverter(Collections.singletonList(c.getDifference())).revert();
    assertNull(myRoot.findChild("f1.txt"));
    assertNotNull(myRoot.findChild("f2.txt"));
}
Also used : DirectoryHistoryDialogModel(com.intellij.history.integration.ui.models.DirectoryHistoryDialogModel) DirectoryChange(com.intellij.history.integration.ui.views.DirectoryChange)

Example 2 with DirectoryChange

use of com.intellij.history.integration.ui.views.DirectoryChange in project intellij-community by JetBrains.

the class DirectoryHistoryDialogModelTest method testDifference.

public void testDifference() throws IOException {
    VirtualFile dir = createDirectory("dir");
    createFile("dir/file.txt");
    initModelFor(dir);
    assertEquals(2, m.getRevisions().size());
    m.selectRevisions(1, 1);
    List<Change> cc = m.getChanges();
    assertEquals(2, cc.size());
    assertEquals("dir", ((DirectoryChange) cc.get(0)).getModel().getEntryName(1));
    assertEquals("file.txt", ((DirectoryChange) cc.get(1)).getModel().getEntryName(1));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) DirectoryChange(com.intellij.history.integration.ui.views.DirectoryChange) Change(com.intellij.openapi.vcs.changes.Change) DirectoryChange(com.intellij.history.integration.ui.views.DirectoryChange)

Aggregations

DirectoryChange (com.intellij.history.integration.ui.views.DirectoryChange)2 DirectoryHistoryDialogModel (com.intellij.history.integration.ui.models.DirectoryHistoryDialogModel)1 Change (com.intellij.openapi.vcs.changes.Change)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1