use of com.intellij.openapi.vcs.VcsException 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.VcsException 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);
}
use of com.intellij.openapi.vcs.VcsException in project intellij-community by JetBrains.
the class SvnRenameTest method testRollbackRenameDir.
// IDEADEV-9755
@Test
public void testRollbackRenameDir() throws Exception {
final VirtualFile child = prepareDirectoriesForRename();
renameFileInCommand(child, "newchild");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final Change change = changeListManager.getChange(myWorkingCopyDir.findChild("newchild"));
Assert.assertNotNull(change);
final List<VcsException> exceptions = new ArrayList<>();
SvnVcs.getInstance(myProject).getRollbackEnvironment().rollbackChanges(Collections.singletonList(change), exceptions, RollbackProgressListener.EMPTY);
Assert.assertTrue(exceptions.isEmpty());
Assert.assertFalse(new File(myWorkingCopyDir.getPath(), "newchild").exists());
Assert.assertTrue(new File(myWorkingCopyDir.getPath(), "child").exists());
}
use of com.intellij.openapi.vcs.VcsException in project intellij-community by JetBrains.
the class SvnAddTest method testDirAfterFile.
// IDEADEV-19308
@Test
public void testDirAfterFile() throws Exception {
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile dir = createDirInCommand(myWorkingCopyDir, "dir");
final VirtualFile file = createFileInCommand(dir, "a.txt", "content");
runAndVerifyStatusSorted("? dir");
final List<VirtualFile> files = new ArrayList<>();
files.add(file);
files.add(dir);
final List<VcsException> errors = SvnVcs.getInstance(myProject).getCheckinEnvironment().scheduleUnversionedFilesForAddition(files);
Assert.assertEquals(0, errors.size());
}
use of com.intellij.openapi.vcs.VcsException in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedNativeTest method testModificationAndAfterRevert.
@Test
public void testModificationAndAfterRevert() throws Exception {
final SvnTestCase.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