Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-07 12:11:35 -0400
committerMichael Valenta2002-06-07 12:11:35 -0400
commit088f11fa860c8164e22ad42ca6394d89b6546031 (patch)
tree3e42f5c431e27750a241d6c910181113da2d0d37
parent96ca61b2d4082c1678c5a32910af7f0d71bed98e (diff)
downloadeclipse.platform.team-088f11fa860c8164e22ad42ca6394d89b6546031.tar.gz
eclipse.platform.team-088f11fa860c8164e22ad42ca6394d89b6546031.tar.xz
eclipse.platform.team-088f11fa860c8164e22ad42ca6394d89b6546031.zip
19161: CVS: Replace With Latest leaves un-added folders
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/PrepareForReplaceVisitor.java33
1 files changed, 19 insertions, 14 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/PrepareForReplaceVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/PrepareForReplaceVisitor.java
index a425cd92d..bbd539ea3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/PrepareForReplaceVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/PrepareForReplaceVisitor.java
@@ -66,21 +66,26 @@ public class PrepareForReplaceVisitor implements ICVSResourceVisitor {
* @see ICVSResourceVisitor#visitFolder(ICVSFolder)
*/
public void visitFolder(ICVSFolder folder) throws CVSException {
- // Visit the children of the folder as appropriate
- if (depth == IResource.DEPTH_INFINITE) {
- folder.acceptChildren(this);
- } else if (depth == IResource.DEPTH_ONE) {
- ICVSResource[] files = folder.members(ICVSFolder.FILE_MEMBERS);
- for (int i = 0; i < files.length; i++) {
- files[i].accept(this);
+ // Delete unmanaged folders if the user wants them deleted
+ if (!folder.isCVSFolder() && CVSProviderPlugin.getPlugin().isReplaceUnmanaged()) {
+ folder.delete();
+ } else {
+ // Visit the children of the folder as appropriate
+ if (depth == IResource.DEPTH_INFINITE) {
+ folder.acceptChildren(this);
+ } else if (depth == IResource.DEPTH_ONE) {
+ ICVSResource[] files = folder.members(ICVSFolder.FILE_MEMBERS);
+ for (int i = 0; i < files.length; i++) {
+ files[i].accept(this);
+ }
}
- }
- // Also delete ignored child files that start with .#
- ICVSResource[] ignoredFiles = folder.members(ICVSFolder.FILE_MEMBERS | ICVSFolder.IGNORED_MEMBERS);
- for (int i = 0; i < ignoredFiles.length; i++) {
- ICVSResource cvsResource = ignoredFiles[i];
- if (cvsResource.getName().startsWith(".#")) { //$NON-NLS-1$
- cvsResource.delete();
+ // Also delete ignored child files that start with .#
+ ICVSResource[] ignoredFiles = folder.members(ICVSFolder.FILE_MEMBERS | ICVSFolder.IGNORED_MEMBERS);
+ for (int i = 0; i < ignoredFiles.length; i++) {
+ ICVSResource cvsResource = ignoredFiles[i];
+ if (cvsResource.getName().startsWith(".#")) { //$NON-NLS-1$
+ cvsResource.delete();
+ }
}
}
monitor.worked(1);

Back to the top