Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-05-06 14:05:47 +0000
committerMichael Valenta2002-05-06 14:05:47 +0000
commit373f5a1cae6e993c6fad442a1e0b6bb95b18ac83 (patch)
tree5c0aaa983f6e504ad92aab1fe9662249a758df28
parentcabbe820146896a41770129029058c9d80f73cd8 (diff)
downloadeclipse.platform.team-PhantomFolderDeletions.tar.gz
eclipse.platform.team-PhantomFolderDeletions.tar.xz
eclipse.platform.team-PhantomFolderDeletions.zip
*** empty log message ***PhantomFolderDeletions
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java31
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java14
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java12
3 files changed, 38 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
index 1c300067a..45ae627e4 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
@@ -225,23 +225,24 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
// The parent must be managed
if (! local.getParent().isCVSFolder())
return;
-
+
+ // If the folder already has CVS info, check that the remote and local match
+ if(local.isManaged() && local.isCVSFolder()) {
+ // Verify that the root and repository are the same
+ FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
+ FolderSyncInfo localInfo = local.getFolderSyncInfo();
+ if ( ! localInfo.getRoot().equals(remoteInfo.getRoot())) {
+ throw new CVSException(Policy.bind("CVSRemoteSyncElement.rootDiffers", new Object[] {local.getName(), remoteInfo.getRoot(), localInfo.getRoot()}));//$NON-NLS-1$
+ } else if ( ! localInfo.getRepository().equals(remoteInfo.getRepository())) {
+ throw new CVSException(Policy.bind("CVSRemoteSyncElement.repositoryDiffers", new Object[] {local.getName(), remoteInfo.getRepository(), localInfo.getRepository()}));//$NON-NLS-1$
+ }
+ // The folders are in sync so just return
+ return;
+ }
+
+ // Ensure that the folder exists locally
if (! local.exists()) {
local.mkdir();
- } else {
- // If the folder already has CVS info, check that the remote and local match
- if(local.isManaged() && local.isCVSFolder()) {
- // Verify that the root and repository are the same
- FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
- FolderSyncInfo localInfo = local.getFolderSyncInfo();
- if ( ! localInfo.getRoot().equals(remoteInfo.getRoot())) {
- throw new CVSException(Policy.bind("CVSRemoteSyncElement.rootDiffers", new Object[] {local.getName(), remoteInfo.getRoot(), localInfo.getRoot()}));//$NON-NLS-1$
- } else if ( ! localInfo.getRepository().equals(remoteInfo.getRepository())) {
- throw new CVSException(Policy.bind("CVSRemoteSyncElement.repositoryDiffers", new Object[] {local.getName(), remoteInfo.getRepository(), localInfo.getRepository()}));//$NON-NLS-1$
- }
- // The folders are in sync so just return
- return;
- }
}
// Since the parent is managed, this will also set the resource sync info. It is
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
index 1dab24efc..ff689ebf5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
@@ -50,13 +50,16 @@ public class CheckoutAsAction extends AddToWorkspaceAction {
// Fetch the members of the folder to see if they contain a .project file.
final boolean[] hasProjectMetaFile = new boolean[] { false };
+ final boolean[] errorOccured = new boolean[] { false };
run(new WorkspaceModifyOperation() {
public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
try {
folders[0].members(monitor);
} catch (TeamException e) {
+ errorOccured[0] = true;
throw new InvocationTargetException(e);
}
+ // Check for the existance of the .project file
try {
folders[0].getFile(".project");
hasProjectMetaFile[0] = true;
@@ -64,8 +67,19 @@ public class CheckoutAsAction extends AddToWorkspaceAction {
// We couldn't retrieve the meta file so assume it doesn't exist
hasProjectMetaFile[0] = false;
}
+ // If the above failed, look for the old .vcm_meta file
+ if (! hasProjectMetaFile[0]) {
+ try {
+ folders[0].getFile(".vcm_meta");
+ hasProjectMetaFile[0] = true;
+ } catch (TeamException e) {
+ // We couldn't retrieve the meta file so assume it doesn't exist
+ hasProjectMetaFile[0] = false;
+ }
+ }
}
}, Policy.bind("CheckoutAsAction.checkoutFailed"), this.PROGRESS_DIALOG); //$NON-NLS-1$
+ if (errorOccured[0]) return;
// Prompt outside a workspace runnable so that the project creation delta can be heard
IProject newProject = null;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java
index 67be80933..147bd77c3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java
@@ -263,14 +263,18 @@ abstract class MergeAction extends Action {
* the folder if it doesn't contain any real changes
*/
private void removeLocallyDeletedFolder(ChangedTeamContainer container) {
- if (hasRealChanges(container, new int[] { ITeamNode.CONFLICTING, ITeamNode.INCOMING })) {
+ boolean hasIncoming = hasRealChanges(container, new int[] { ITeamNode.INCOMING });
+ boolean hasOutgoing = hasRealChanges(container, new int[] { ITeamNode.OUTGOING });
+ boolean hasConflicting = hasRealChanges(container, new int[] { ITeamNode.CONFLICTING });
+ IDiffContainer parent = container.getParent();
+ if (hasConflicting || (hasOutgoing && hasIncoming)) {
// Leave as a conflict
return;
- }
- IDiffContainer parent = container.getParent();
- if (hasRealChanges(container, new int[] { ITeamNode.OUTGOING })) {
+ } else if (hasOutgoing) {
// Convert to an outgoing deletion
container.setKind(ITeamNode.OUTGOING | Differencer.DELETION);
+ } else if (hasIncoming) {
+ container.setKind(ITeamNode.INCOMING | Differencer.ADDITION);
} else {
// The folder is empty, remove it
if (parent != null) {

Back to the top