mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-96544 Subversion: when confirmation for delete= "do nothing silently", you can not delete versioned folder [^kirill.l]
+ tests
This commit is contained in:
@@ -456,6 +456,9 @@ public class SvnFileSystemListener extends CommandAdapter implements LocalFileOp
|
||||
return true;
|
||||
}
|
||||
if (vcs == null) return false;
|
||||
final VcsShowConfirmationOption.Value value = vcs.getDeleteConfirmation().getValue();
|
||||
if (VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY.equals(value)) return false;
|
||||
|
||||
final File ioFile = getIOFile(file);
|
||||
if (! SvnUtil.isSvnVersioned(vcs.getProject(), ioFile.getParentFile())) {
|
||||
return false;
|
||||
@@ -556,6 +559,9 @@ public class SvnFileSystemListener extends CommandAdapter implements LocalFileOp
|
||||
if (vcs == null) {
|
||||
return false;
|
||||
}
|
||||
final VcsShowConfirmationOption.Value value = vcs.getAddConfirmation().getValue();
|
||||
if (VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY.equals(value)) return false;
|
||||
|
||||
if (isUndo(vcs) && SvnUtil.isAdminDirectory(dir, name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,9 @@ public class SvnAddTest extends Svn17TestCase {
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile dir = createDirInCommand(myWorkingCopyDir, "dir");
|
||||
final VirtualFile file = createFileInCommand(dir, "a.txt", "content");
|
||||
|
||||
|
||||
verify(runSvn("status"), "? dir");
|
||||
|
||||
final List<VirtualFile> files = new ArrayList<VirtualFile>();
|
||||
files.add(file);
|
||||
files.add(dir);
|
||||
|
||||
@@ -64,4 +64,20 @@ public class SvnDeleteTest extends Svn17TestCase {
|
||||
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");
|
||||
|
||||
verify(runSvn("status"), "A child", "A child" + File.separatorChar + "a.txt");
|
||||
checkin();
|
||||
|
||||
final File wasFile = new File(dir.getPath());
|
||||
deleteFileInCommand(dir);
|
||||
verify(runSvn("status"), "! child", "! child" + File.separatorChar + "a.txt");
|
||||
Assert.assertTrue(! wasFile.exists());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,9 @@ public class SvnAddTest extends Svn16TestCase {
|
||||
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
final VirtualFile dir = createDirInCommand(myWorkingCopyDir, "dir");
|
||||
final VirtualFile file = createFileInCommand(dir, "a.txt", "content");
|
||||
|
||||
|
||||
verify(runSvn("status"), "? dir");
|
||||
|
||||
final List<VirtualFile> files = new ArrayList<VirtualFile>();
|
||||
files.add(file);
|
||||
files.add(dir);
|
||||
|
||||
@@ -64,4 +64,20 @@ public class SvnDeleteTest extends Svn16TestCase {
|
||||
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");
|
||||
|
||||
verify(runSvn("status"), "A child", "A child" + File.separatorChar + "a.txt");
|
||||
checkin();
|
||||
|
||||
final File wasFile = new File(dir.getPath());
|
||||
deleteFileInCommand(dir);
|
||||
verify(runSvn("status"), "! child");
|
||||
Assert.assertTrue(! wasFile.exists());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user