Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-08-05 18:15:13 +0000
committerJean Michel-Lemieux2003-08-05 18:15:13 +0000
commit9d12a6e8a73f727b18f2db040eba1c3684058cf3 (patch)
treed0d992ea674c96e9a6cdac40b02c499d0b0cc081 /bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui
parent5ec1455fb62e518938e6b2cea77a7462a0fd3684 (diff)
downloadeclipse.platform.team-9d12a6e8a73f727b18f2db040eba1c3684058cf3.tar.gz
eclipse.platform.team-9d12a6e8a73f727b18f2db040eba1c3684058cf3.tar.xz
eclipse.platform.team-9d12a6e8a73f727b18f2db040eba1c3684058cf3.zip
Added explicit override and commit action and change dupdate to not perform the override and update.
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java37
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java35
4 files changed, 60 insertions, 33 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
index c5b367f4e..4b398950d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
@@ -43,6 +43,13 @@ import org.eclipse.team.ui.sync.SyncInfoSet;
public class MergeUpdateAction extends SafeUpdateAction {
/* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateAction#getOverwriteLocalChanges()
+ */
+ protected boolean getOverwriteLocalChanges() {
+ return true;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
protected SyncInfoFilter getSyncInfoFilter() {
@@ -198,5 +205,5 @@ public class MergeUpdateAction extends SafeUpdateAction {
if (!cvsFolder.exists()) {
cvsFolder.mkdir();
}
- }
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
new file mode 100644
index 000000000..4c5832707
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.ui.subscriber;
+
+import org.eclipse.team.ui.sync.SyncInfoSet;
+
+public class OverrideAndCommitAction extends SubscriberCommitAction {
+
+ protected boolean promptForConflictHandling(SyncInfoSet syncSet) {
+ // If there is a conflict in the syncSet, we need to prompt the user before proceeding.
+ if (syncSet.hasConflicts() || syncSet.hasIncomingChanges()) {
+ switch (promptForConflicts(syncSet)) {
+ case 0:
+ // Yes, synchronize conflicts as well
+ break;
+ case 1:
+ // No, only synchronize non-conflicting changes.
+ syncSet.removeConflictingNodes();
+ syncSet.removeIncomingNodes();
+ break;
+ case 2:
+ default:
+ // Cancel
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
index e4cd6d4d9..d2d54e130 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
@@ -73,9 +73,11 @@ public abstract class SafeUpdateAction extends CVSSubscriberAction {
});
// Ask the user if a replace should be performed on the remaining nodes
- if (!failedSet.isEmpty() && promptForOverwrite(failedSet)) {
- overwriteUpdate(failedSet, Policy.subMonitorFor(monitor, willFail.length * 100));
- syncSet.addAll(failedSet);
+ if(getOverwriteLocalChanges()) {
+ if (!failedSet.isEmpty() && promptForOverwrite(failedSet)) {
+ overwriteUpdate(failedSet, Policy.subMonitorFor(monitor, willFail.length * 100));
+ syncSet.addAll(failedSet);
+ }
}
updated(syncSet.getResources());
@@ -84,6 +86,10 @@ public abstract class SafeUpdateAction extends CVSSubscriberAction {
}
}
+ protected boolean getOverwriteLocalChanges(){
+ return false;
+ }
+
/**
* Perform a safe update on the resources in the provided set. Any included resources
* that cannot be updated safely wil be added to the skippedFiles list.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java
index 61be13a42..6a224ae81 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SubscriberCommitAction.java
@@ -30,14 +30,9 @@ import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.sync.ToolTipMessageDialog;
+import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.sync.SyncInfoSet;
-/**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
public class SubscriberCommitAction extends CVSSubscriberAction {
private String comment;
@@ -51,34 +46,16 @@ public class SubscriberCommitAction extends CVSSubscriberAction {
try {
if (!promptForUnaddedHandling(syncSet)) return null;
} catch (CVSException e) {
- // TODO Could prompt the user with option to continue
- // instead of just continuing
- CVSUIPlugin.log(e);
+ Utils.handle(e);
}
return syncSet;
}
- /**
- * @param syncSet
- * @return
- */
- private boolean promptForConflictHandling(SyncInfoSet syncSet) {
- // If there is a conflict in the syncSet, we need to prompt the user before proceeding.
+ protected boolean promptForConflictHandling(SyncInfoSet syncSet) {
+ // If there is a conflict in the syncSet, remove from sync set.
if (syncSet.hasConflicts() || syncSet.hasIncomingChanges()) {
- switch (promptForConflicts(syncSet)) {
- case 0:
- // Yes, synchronize conflicts as well
- break;
- case 1:
- // No, only synchronize non-conflicting changes.
- syncSet.removeConflictingNodes();
- syncSet.removeIncomingNodes();
- break;
- case 2:
- default:
- // Cancel
- return false;
- }
+ syncSet.removeConflictingNodes();
+ syncSet.removeIncomingNodes();
}
return true;
}

Back to the top