Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-12-03 10:42:37 -0500
committerMichael Valenta2003-12-03 10:42:37 -0500
commit540f4104c2328feb8bd6f0af2f82ad153e9c03f6 (patch)
tree9b53d975f8532cde45bc8277fd2441217a9739e9
parent4356eb10b8e7cf9e33a78b9362b082224776b422 (diff)
downloadeclipse.platform.team-540f4104c2328feb8bd6f0af2f82ad153e9c03f6.tar.gz
eclipse.platform.team-540f4104c2328feb8bd6f0af2f82ad153e9c03f6.tar.xz
eclipse.platform.team-540f4104c2328feb8bd6f0af2f82ad153e9c03f6.zip
47719: Error while updating to undo folder move
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java18
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java2
2 files changed, 12 insertions, 8 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
index e9cb631c7..57b0cba54 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/ReplaceOperation.java
@@ -76,16 +76,20 @@ public class ReplaceOperation extends UpdateOperation {
recurse ? IResource.DEPTH_INFINITE : IResource.DEPTH_ZERO,
Policy.subMonitorFor(monitor, 30)); //$NON-NLS-1$
- // Prune any empty folders left after the resources were purged
- new PruneFolderVisitor().visit(session, resources);
-
// Only perform the remote command if some of the resources being replaced were managed
- if (managedResources.length == 0) {
- return OK;
- } else {
+ IStatus status = OK;
+ if (managedResources.length > 0) {
// Perform an update, ignoring any local file modifications
- return super.executeCommand(session, provider, managedResources, Policy.subMonitorFor(monitor, 70));
+ status = super.executeCommand(session, provider, managedResources, Policy.subMonitorFor(monitor, 70));
+ }
+
+ // Prune any empty folders left after the resources were purged.
+ // This is done to prune any empty folders that contained only unmanaged resources
+ if (status.isOK() && CVSProviderPlugin.getPlugin().getPruneEmptyDirectories()) {
+ new PruneFolderVisitor().visit(session, resources);
}
+
+ return status;
} finally {
monitor.done();
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java
index 6db4cf792..7d06341dd 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java
@@ -1197,7 +1197,7 @@ public class CVSWorkspaceSubscriberTest extends CVSSyncSubscriberTest {
IProject project = createProject(new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder1/b.txt"});
IFolder newFolder = project.getFolder("newFolder");
newFolder.create(false, true, null);
- IFile newFile = newFolder.getFile("newFile");
+ buildResources(newFolder, new String[] {"newFile"}, false);
overrideAndUpdate(project, new String[] {"newFolder", "newFolder/newFile"}, true);
assertDoesNotExistInFileSystem(newFolder);
}

Back to the top