use of com.intellij.openapi.vcs.changes.ui.RollbackWorker in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedNativeTest method testDeleteDirEditFileAndAfterRevert.
@Test
public void testDeleteDirEditFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
deleteFileInCommand(subTree.myRootDir);
sleep(300);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final List<VirtualFile> files = getAllFiles(subTree);
DuringChangeListManagerUpdateTestScheme.checkDeletedFilesAreInList(VfsUtil.toVirtualFileArray(files), clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
assertVF(subTree.myRootDir, "source");
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.myRootDir, "target");
assertVF(subTree.myTargetDir, "t11.txt");
assertVF(subTree.myTargetDir, "t13.txt");
assertVF(subTree.myTargetDir, "t14.txt");
assertVF(subTree.myTargetDir, "t15.txt");
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager);
}
use of com.intellij.openapi.vcs.changes.ui.RollbackWorker in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedNativeTest method testModificationAndAfterRevert.
@Test
public void testModificationAndAfterRevert() throws Exception {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
sleep(100);
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
sleep(100);
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(virtualToIoFile(subTree.myS1File));
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final VcsException updateException = ((ChangeListManagerImpl) clManager).getUpdateException();
if (updateException != null) {
updateException.printStackTrace();
}
Assert.assertNull(updateException == null ? null : updateException.getMessage(), updateException);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] { subTree.myS1File }, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
final CharSequence text = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals(SubTree.ourS1Contents, text.toString());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager);
}
use of com.intellij.openapi.vcs.changes.ui.RollbackWorker in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedNativeTest method testMoveDirEditFileAndAfterRevert.
@Test
public void testMoveDirEditFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
moveFileInCommand(subTree.mySourceDir, subTree.myTargetDir);
Assert.assertTrue(subTree.mySourceDir.getPath().endsWith("/target/source"));
assertVF(subTree.myTargetDir, "source");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new", text1.toString());
sleep(300);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] { subTree.mySourceDir, subTree.myS1File, subTree.myS2File }, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
subTree.mySourceDir = assertVF(subTree.myRootDir, "source");
Assert.assertTrue(subTree.mySourceDir.getPath().endsWith("/root/source"));
subTree.myS1File = assertVF(subTree.mySourceDir, "s1.txt");
subTree.myS2File = assertVF(subTree.mySourceDir, "s2.txt");
final CharSequence text = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals(SubTree.ourS1Contents, text.toString());
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager);
}
use of com.intellij.openapi.vcs.changes.ui.RollbackWorker in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedTest method testAddDirEditFileAndAfterRevert.
@Test
public void testAddDirEditFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final List<VirtualFile> files = getAllFiles(subTree);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VfsUtil.toVirtualFileArray(files), clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
assertVF(subTree.myRootDir, "source");
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.myRootDir, "target");
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager);
for (VirtualFile file : files) {
Assert.assertTrue(file.getPath(), clManager.isUnversioned(file));
}
}
use of com.intellij.openapi.vcs.changes.ui.RollbackWorker in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedTest method testModificationAndAfterRevert.
@Test
public void testModificationAndAfterRevert() throws Exception {
//ChangeListManagerImpl.DEBUG = true;
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
sleep(100);
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
sleep(100);
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(virtualToIoFile(subTree.myS1File));
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final VcsException updateException = ((ChangeListManagerImpl) clManager).getUpdateException();
if (updateException != null) {
updateException.printStackTrace();
}
Assert.assertNull(updateException == null ? null : updateException.getMessage(), updateException);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] { subTree.myS1File }, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
final CharSequence text = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals(SubTree.ourS1Contents, text.toString());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager);
}
Aggregations