mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
svn: Remove unnecessary svn 1.6 tests and test data
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
# suppress inspection "UnusedProperty" for whole file
|
||||
[DISABLED_TESTS]
|
||||
org.jetbrains.idea.svn.*
|
||||
org.jetbrains.idea.svn16.*
|
||||
com.intellij.util.net.ssl.*
|
||||
com.intellij.tasks.live.*
|
||||
com.intellij.debugger.impl.CaptureWithAgentTest
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.idea.svn16;
|
||||
|
||||
public abstract class Svn16TestCase extends org.jetbrains.idea.SvnTestCase {
|
||||
protected Svn16TestCase() {
|
||||
super("testData16");
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.idea.svn16;
|
||||
|
||||
import com.intellij.openapi.vcs.VcsConfiguration;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.openapi.vcs.changes.LocalChangeList;
|
||||
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.jetbrains.idea.svn.integrate.AlienDirtyScope;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class SvnDeleteTest extends Svn16TestCase {
|
||||
// IDEADEV-16066
|
||||
@Test
|
||||
public void testDeletePackage() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
|
||||
VirtualFile dir = createDirInCommand(myWorkingCopyDir, "child");
|
||||
createFileInCommand(dir, "a.txt", "content");
|
||||
|
||||
runAndVerifyStatus("A child", "A child" + File.separatorChar + "a.txt");
|
||||
checkin();
|
||||
|
||||
deleteFileInCommand(dir);
|
||||
runAndVerifyStatus("D child", "D child" + File.separatorChar + "a.txt");
|
||||
|
||||
refreshVfs();
|
||||
|
||||
final AlienDirtyScope dirtyScope = new AlienDirtyScope();
|
||||
dirtyScope.addDir(VcsUtil.getFilePath(myWorkingCopyDir));
|
||||
final List<Change> changesManually = getChangesInScope(dirtyScope);
|
||||
Assert.assertEquals(2, changesManually.size());
|
||||
|
||||
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
|
||||
// since ChangeListManager is runnning, it can take dirty scope itself;... it's easier to just take changes from it
|
||||
final ChangeListManager clManager = ChangeListManager.getInstance(myProject);
|
||||
clManager.ensureUpToDate(false);
|
||||
final List<LocalChangeList> lists = clManager.getChangeListsCopy();
|
||||
Assert.assertEquals(1, lists.size());
|
||||
final Collection<Change> changes = lists.get(0).getChanges();
|
||||
Assert.assertEquals(2, changes.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeletePackageWhenVcsRemoveDisabled() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
|
||||
VirtualFile dir = createDirInCommand(myWorkingCopyDir, "child");
|
||||
createFileInCommand(dir, "a.txt", "content");
|
||||
|
||||
runAndVerifyStatus("A child", "A child" + File.separatorChar + "a.txt");
|
||||
checkin();
|
||||
|
||||
final File wasFile = virtualToIoFile(dir);
|
||||
deleteFileInCommand(dir);
|
||||
runAndVerifyStatus("! child");
|
||||
Assert.assertTrue(! wasFile.exists());
|
||||
}
|
||||
}
|
||||
@@ -1,381 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.idea.svn16;
|
||||
|
||||
import com.intellij.execution.process.ProcessOutput;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.VcsConfiguration;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.openapi.vcs.rollback.RollbackProgressListener;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.TimeoutUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.idea.svn.SvnVcs;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class SvnRenameTest extends Svn16TestCase {
|
||||
@NonNls private static final String LOG_SEPARATOR = "------------------------------------------------------------------------\n";
|
||||
@NonNls private static final String LOG_SEPARATOR_START = "-------------";
|
||||
|
||||
@Test
|
||||
public void testSimpleRename() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile a = createFileInCommand("a.txt", "test");
|
||||
checkin();
|
||||
|
||||
renameFileInCommand(a, "b.txt");
|
||||
verifySorted(runSvn("status"), "A + b.txt", "D a.txt");
|
||||
}
|
||||
|
||||
// IDEADEV-18844
|
||||
@Test
|
||||
public void testRenameReplace() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile a = createFileInCommand("a.txt", "old");
|
||||
final VirtualFile aNew = createFileInCommand("aNew.txt", "new");
|
||||
checkin();
|
||||
|
||||
renameFileInCommand(a, "aOld.txt");
|
||||
renameFileInCommand(aNew, "a.txt");
|
||||
final ProcessOutput result = runSvn("status");
|
||||
verifySorted(result, "A + aOld.txt", "D aNew.txt", "R + a.txt");
|
||||
}
|
||||
|
||||
// IDEADEV-16251
|
||||
@Test
|
||||
public void testRenameAddedPackage() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile dir = createDirInCommand(myWorkingCopyDir, "child");
|
||||
createFileInCommand(dir, "a.txt", "content");
|
||||
renameFileInCommand(dir, "newchild");
|
||||
verifySorted(runSvn("status"), "A newchild", "A newchild" + File.separatorChar + "a.txt");
|
||||
}
|
||||
|
||||
// IDEADEV-8091
|
||||
@Test
|
||||
public void testDoubleRename() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile a = createFileInCommand("a.txt", "test");
|
||||
checkin();
|
||||
|
||||
renameFileInCommand(a, "b.txt");
|
||||
renameFileInCommand(a, "c.txt");
|
||||
verifySorted(runSvn("status"), "A + c.txt", "D a.txt");
|
||||
}
|
||||
|
||||
// IDEADEV-15876
|
||||
@Test
|
||||
public void testRenamePackageWithChildren() throws Exception {
|
||||
final VirtualFile child = prepareDirectoriesForRename();
|
||||
|
||||
renameFileInCommand(child, "childnew");
|
||||
final ProcessOutput result = runSvn("status");
|
||||
verifySorted(result, "A + childnew",
|
||||
"D child",
|
||||
"D child" + File.separatorChar + "a.txt",
|
||||
"D child" + File.separatorChar + "grandChild",
|
||||
"D child" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt");
|
||||
|
||||
refreshVfs(); // wait for end of refresh operations initiated from SvnFileSystemListener
|
||||
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
|
||||
changeListManager.ensureUpToDate(false);
|
||||
List<Change> changes = new ArrayList<>(changeListManager.getDefaultChangeList().getChanges());
|
||||
Assert.assertEquals(4, changes.size());
|
||||
sortChanges(changes);
|
||||
verifyChange(changes.get(0), "child", "childnew");
|
||||
verifyChange(changes.get(1), "child" + File.separatorChar + "a.txt", "childnew" + File.separatorChar + "a.txt");
|
||||
verifyChange(changes.get(2), "child" + File.separatorChar + "grandChild", "childnew" + File.separatorChar + "grandChild");
|
||||
verifyChange(changes.get(3), "child" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt", "childnew" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt");
|
||||
|
||||
VirtualFile oldChild = myWorkingCopyDir.findChild("child");
|
||||
Assert.assertEquals(FileStatus.DELETED, changeListManager.getStatus(oldChild));
|
||||
}
|
||||
|
||||
private VirtualFile prepareDirectoriesForRename() throws IOException {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile child = createDirInCommand(myWorkingCopyDir, "child");
|
||||
final VirtualFile grandChild = createDirInCommand(child, "grandChild");
|
||||
createFileInCommand(child, "a.txt", "a");
|
||||
createFileInCommand(grandChild, "b.txt", "b");
|
||||
checkin();
|
||||
return child;
|
||||
}
|
||||
|
||||
// IDEADEV-19065
|
||||
@Test
|
||||
public void testCommitAfterRenameDir() throws Exception {
|
||||
final VirtualFile child = prepareDirectoriesForRename();
|
||||
|
||||
renameFileInCommand(child, "newchild");
|
||||
checkin();
|
||||
|
||||
final ProcessOutput runResult = runSvn("log", "-q", "newchild/a.txt");
|
||||
verify(runResult);
|
||||
final List<String> lines = StringUtil.split(runResult.getStdout(), "\n");
|
||||
for (Iterator<String> iterator = lines.iterator(); iterator.hasNext();) {
|
||||
final String next = iterator.next();
|
||||
if (next.startsWith(LOG_SEPARATOR_START)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
Assert.assertEquals(2, lines.size());
|
||||
Assert.assertTrue(lines.get(0).startsWith("r2 |"));
|
||||
Assert.assertTrue(lines.get(1).startsWith("r1 |"));
|
||||
}
|
||||
|
||||
// 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());
|
||||
}
|
||||
|
||||
// IDEADEV-7697
|
||||
@Test
|
||||
public void testMovePackageToParent() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile child = createDirInCommand(myWorkingCopyDir, "child");
|
||||
final VirtualFile grandChild = createDirInCommand(child, "grandChild");
|
||||
createFileInCommand(grandChild, "a.txt", "a");
|
||||
checkin();
|
||||
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
|
||||
|
||||
moveFileInCommand(grandChild, myWorkingCopyDir);
|
||||
refreshVfs(); // wait for end of refresh operations initiated from SvnFileSystemListener
|
||||
changeListManager.ensureUpToDate(false);
|
||||
final List<Change> changes = new ArrayList<>(changeListManager.getDefaultChangeList().getChanges());
|
||||
Assert.assertEquals(listToString(changes), 2, changes.size());
|
||||
sortChanges(changes);
|
||||
verifyChange(changes.get(0), "child" + File.separatorChar + "grandChild", "grandChild");
|
||||
verifyChange(changes.get(1), "child" + File.separatorChar + "grandChild" + File.separatorChar + "a.txt", "grandChild" + File.separatorChar + "a.txt");
|
||||
}
|
||||
|
||||
private String listToString(final List<Change> changes) {
|
||||
return "{" + StringUtil.join(changes, StringUtil.createToStringFunction(Change.class), ",") + "}";
|
||||
}
|
||||
|
||||
// IDEADEV-19223
|
||||
@Test
|
||||
public void testRollbackRenameWithUnversioned() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile child = createDirInCommand(myWorkingCopyDir, "child");
|
||||
createFileInCommand(child, "a.txt", "a");
|
||||
checkin();
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile unversioned = createFileInCommand(child, "u.txt", "u");
|
||||
final VirtualFile unversionedDir = createDirInCommand(child, "uc");
|
||||
createFileInCommand(unversionedDir, "c.txt", "c");
|
||||
|
||||
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
|
||||
changeListManager.ensureUpToDate(false);
|
||||
Assert.assertEquals(FileStatus.UNKNOWN, changeListManager.getStatus(unversioned));
|
||||
|
||||
renameFileInCommand(child, "newchild");
|
||||
File childPath = new File(myWorkingCopyDir.getPath(), "child");
|
||||
File newChildPath = new File(myWorkingCopyDir.getPath(), "newchild");
|
||||
Assert.assertTrue(new File(newChildPath, "a.txt").exists());
|
||||
Assert.assertTrue(new File(newChildPath, "u.txt").exists());
|
||||
Assert.assertFalse(new File(childPath, "u.txt").exists());
|
||||
|
||||
refreshVfs();
|
||||
changeListManager.ensureUpToDate(false);
|
||||
final List<Change> changes = new ArrayList<>();
|
||||
changes.add(ChangeListManager.getInstance(myProject).getChange(myWorkingCopyDir.findChild("newchild").findChild("a.txt")));
|
||||
changes.add(ChangeListManager.getInstance(myProject).getChange(myWorkingCopyDir.findChild("newchild")));
|
||||
|
||||
final List<VcsException> exceptions = new ArrayList<>();
|
||||
SvnVcs.getInstance(myProject).getRollbackEnvironment().rollbackChanges(changes, exceptions, RollbackProgressListener.EMPTY);
|
||||
TimeoutUtil.sleep(300);
|
||||
Assert.assertTrue(exceptions.isEmpty());
|
||||
final File fileA = new File(childPath, "a.txt");
|
||||
Assert.assertTrue(fileA.getAbsolutePath(), fileA.exists());
|
||||
final File fileU = new File(childPath, "u.txt");
|
||||
Assert.assertTrue(fileU.getAbsolutePath(), fileU.exists());
|
||||
final File unversionedDirFile = new File(childPath, "uc");
|
||||
Assert.assertTrue(unversionedDirFile.exists());
|
||||
Assert.assertTrue(new File(unversionedDirFile, "c.txt").exists());
|
||||
}
|
||||
|
||||
// IDEA-13824
|
||||
@Test
|
||||
public void testRenameFileRenameDir() throws Exception {
|
||||
final VirtualFile child = prepareDirectoriesForRename();
|
||||
final VirtualFile f = child.findChild("a.txt");
|
||||
renameFileInCommand(f, "anew.txt");
|
||||
renameFileInCommand(child, "newchild");
|
||||
|
||||
verifySorted(runSvn("status"), "A + newchild", "A + newchild" + File.separatorChar + "anew.txt",
|
||||
"D child", "D child" + File.separatorChar + "a.txt", "D child" + File.separatorChar + "grandChild", "D child" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt", "D + newchild" + File.separatorChar + "a.txt");
|
||||
|
||||
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
|
||||
refreshVfs(); // wait for end of refresh operations initiated from SvnFileSystemListener
|
||||
changeListManager.ensureUpToDate(false);
|
||||
final List<Change> changes = new ArrayList<>(changeListManager.getDefaultChangeList().getChanges());
|
||||
final List<VcsException> list = SvnVcs.getInstance(myProject).getCheckinEnvironment().commit(changes, "test");
|
||||
Assert.assertEquals(0, list.size());
|
||||
}
|
||||
|
||||
// IDEADEV-19364
|
||||
@Test
|
||||
public void testUndoMovePackage() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile parent1 = createDirInCommand(myWorkingCopyDir, "parent1");
|
||||
final VirtualFile parent2 = createDirInCommand(myWorkingCopyDir, "parent2");
|
||||
final VirtualFile child = createDirInCommand(parent1, "child");
|
||||
createFileInCommand(child, "a.txt", "a");
|
||||
checkin();
|
||||
|
||||
moveFileInCommand(child, parent2);
|
||||
undo();
|
||||
final File childPath = new File(parent1.getPath(), "child");
|
||||
Assert.assertTrue(childPath.exists());
|
||||
Assert.assertTrue(new File(childPath, "a.txt").exists());
|
||||
}
|
||||
|
||||
// IDEADEV-19552
|
||||
@Test
|
||||
public void testUndoRename() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A");
|
||||
checkin();
|
||||
|
||||
renameFileInCommand(file, "b.txt");
|
||||
undo();
|
||||
Assert.assertTrue(new File(myWorkingCopyDir.getPath(), "a.txt").exists());
|
||||
Assert.assertFalse(new File(myWorkingCopyDir.getPath(), "b.txt").exists());
|
||||
}
|
||||
|
||||
// IDEADEV-19336
|
||||
/*@Bombed(user = "Ira", month = 6, day = 15)
|
||||
@Test
|
||||
public void testUndoMoveCommittedPackage() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
|
||||
final VirtualFile parent1 = createDirInCommand(myWorkingCopyDir, "parent1");
|
||||
final VirtualFile parent2 = createDirInCommand(myWorkingCopyDir, "parent2");
|
||||
final VirtualFile child = createDirInCommand(parent1, "child");
|
||||
createFileInCommand(child, "a.txt", "a");
|
||||
checkin();
|
||||
|
||||
moveFileInCommand(child, parent2);
|
||||
checkin();
|
||||
|
||||
undo();
|
||||
verifySorted(runSvn("status"), "A + parent1" + File.separatorChar + "child", "D parent2" + File.separatorChar + "child", "D parent2" + File.separatorChar + "child" + File.separatorChar + "a.txt");
|
||||
}*/
|
||||
|
||||
@Test
|
||||
public void testMoveToNewPackage() throws Throwable {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A");
|
||||
moveToNewPackage(file, "child");
|
||||
verifySorted(runSvn("status"), "A child", "A child" + File.separatorChar + "a.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMoveToNewPackageCommitted() throws Throwable {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A");
|
||||
checkin();
|
||||
moveToNewPackage(file, "child");
|
||||
verifySorted(runSvn("status"), "A child", "A + child" + File.separatorChar + "a.txt", "D a.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMoveToUnversioned() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A");
|
||||
final VirtualFile child = moveToNewPackage(file, "child");
|
||||
verifySorted(runSvn("status"), "A child", "A child" + File.separatorChar + "a.txt");
|
||||
checkin();
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile unversioned = createDirInCommand(myWorkingCopyDir, "unversioned");
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
verifySorted(runSvn("status"), "? unversioned");
|
||||
|
||||
moveFileInCommand(child, unversioned);
|
||||
verifySorted(runSvn("status"), "? unversioned", "D child", "D child" + File.separator + "a.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUndoMoveUnversionedToUnversioned() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A");
|
||||
verifySorted(runSvn("status"), "? a.txt");
|
||||
final VirtualFile unversioned = createDirInCommand(myWorkingCopyDir, "unversioned");
|
||||
moveFileInCommand(file, unversioned);
|
||||
verifySorted(runSvn("status"), "? unversioned");
|
||||
undo();
|
||||
verifySorted(runSvn("status"), "? a.txt", "? unversioned");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUndoMoveAddedToUnversioned() throws Exception {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
|
||||
final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A");
|
||||
verifySorted(runSvn("status"), "A a.txt");
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile unversioned = createDirInCommand(myWorkingCopyDir, "unversioned");
|
||||
moveFileInCommand(file, unversioned);
|
||||
verifySorted(runSvn("status"), "? unversioned");
|
||||
undo();
|
||||
verifySorted(runSvn("status"), "? a.txt", "? unversioned");
|
||||
}
|
||||
|
||||
private VirtualFile moveToNewPackage(final VirtualFile file, final String packageName) {
|
||||
final VirtualFile[] dir = new VirtualFile[1];
|
||||
WriteCommandAction.writeCommandAction(myProject).run(() -> {
|
||||
try {
|
||||
dir[0] = myWorkingCopyDir.createChildDirectory(this, packageName);
|
||||
file.move(this, dir[0]);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
return dir[0];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user