use of com.intellij.openapi.vcs.changes.ui.RollbackWorker in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedNativeTest method testRenameDirAndAfterRevert.
@Test
public void testRenameDirAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
final String newName = "newName";
renameFileInCommand(subTree.mySourceDir, newName);
assertVF(subTree.myRootDir, newName);
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.mySourceDir, "s2.txt");
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"));
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.mySourceDir, "s2.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 testRenameFileAndAfterRevert.
@Test
public void testRenameFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
final String newName = "newName";
renameFileInCommand(subTree.myS1File, newName);
assertVF(subTree.mySourceDir, newName);
sleep(300);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
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);
assertVF(subTree.mySourceDir, "s1.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 SvnChangesCorrectlyRefreshedTest method testRenameDirAndAfterRevert.
@Test
public void testRenameDirAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
final String newName = "newName";
renameFileInCommand(subTree.mySourceDir, newName);
assertVF(subTree.myRootDir, newName);
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.mySourceDir, "s2.txt");
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"));
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.mySourceDir, "s2.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 SvnChangesCorrectlyRefreshedTest 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 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));
}
}
Aggregations