Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-03-20 17:07:42 +0000
committerjames2002-03-20 17:07:42 +0000
commitbc1ba5ec06edc8c6fcb9956d1694d318539285e7 (patch)
tree2f4070f5f4187d55ed18c06d5f599b87aa4f1a3c
parentcb8e72accc58d3f4aead001ea93ed17e6bcfe036 (diff)
downloadeclipse.platform.team-bc1ba5ec06edc8c6fcb9956d1694d318539285e7.tar.gz
eclipse.platform.team-bc1ba5ec06edc8c6fcb9956d1694d318539285e7.tar.xz
eclipse.platform.team-bc1ba5ec06edc8c6fcb9956d1694d318539285e7.zip
11373: Merging changes into local action broken
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java31
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java7
3 files changed, 37 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java
new file mode 100644
index 000000000..8a3ec6ede
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java
@@ -0,0 +1,31 @@
+package org.eclipse.team.internal.ccvs.ui.merge;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
+import org.eclipse.team.ui.sync.ITeamNode;
+import org.eclipse.team.ui.sync.SyncSet;
+
+public class OverrideUpdateMergeAction extends UpdateMergeAction {
+ public OverrideUpdateMergeAction(CVSSyncCompareInput model, ISelectionProvider sp, String label, Shell shell) {
+ super(model, sp, label, shell);
+ }
+ /*
+ * Override removeNonApplicableNodes because conflicting nodes should not be removed from this set.
+ */
+ protected void removeNonApplicableNodes(SyncSet set, int syncMode) {
+ set.removeOutgoingNodes();
+ set.removeIncomingNodes();
+ }
+ protected boolean isEnabled(ITeamNode node) {
+ // The force update action is enabled only for conflicting and outgoing changes
+ SyncSet set = new SyncSet(new StructuredSelection(node));
+ return set.hasConflicts();
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java
index 83d2ff585..48f6a2276 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java
@@ -77,5 +77,6 @@ public class UpdateWithForcedJoinAction extends UpdateMergeAction {
*/
protected void removeNonApplicableNodes(SyncSet set, int syncMode) {
set.removeOutgoingNodes();
+ set.removeIncomingNodes();
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
index 8f2231307..36318b442 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
@@ -37,6 +37,7 @@ import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.HistoryView;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.merge.OverrideUpdateMergeAction;
import org.eclipse.team.internal.ccvs.ui.merge.UpdateMergeAction;
import org.eclipse.team.internal.ccvs.ui.merge.UpdateWithForcedJoinAction;
import org.eclipse.team.ui.sync.CatchupReleaseViewer;
@@ -55,6 +56,7 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
private UpdateWithForcedJoinAction updateWithJoinAction;
private IgnoreAction ignoreAction;
private HistoryAction showInHistory;
+ private OverrideUpdateMergeAction forceUpdateMergeAction;
class DiffImage extends CompositeImageDescriptor {
private static final int HEIGHT= 16;
@@ -220,10 +222,10 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
break;
case SyncView.SYNC_MERGE:
updateMergeAction.update(SyncView.SYNC_INCOMING);
- forceUpdateAction.update(SyncView.SYNC_INCOMING);
+ forceUpdateMergeAction.update(SyncView.SYNC_INCOMING);
updateWithJoinAction.update(SyncView.SYNC_INCOMING);
manager.add(updateMergeAction);
- manager.add(forceUpdateAction);
+ manager.add(forceUpdateMergeAction);
manager.add(updateWithJoinAction);
break;
}
@@ -241,6 +243,7 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
updateMergeAction = new UpdateMergeAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.update"), shell);
ignoreAction = new IgnoreAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.ignore"), shell);
updateWithJoinAction = new UpdateWithForcedJoinAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.mergeUpdate"), shell);
+ forceUpdateMergeAction = new OverrideUpdateMergeAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.forceUpdate"), shell);
// Show in history view
showInHistory = new HistoryAction(Policy.bind("CVSCatchupReleaseViewer.showInHistory"));

Back to the top