From 9d12a6e8a73f727b18f2db040eba1c3684058cf3 Mon Sep 17 00:00:00 2001
From: Jean Michel-Lemieux
Date: Tue, 5 Aug 2003 18:15:13 +0000
Subject: Added explicit override and commit action and change dupdate to not
perform the override and update.
---
bundles/org.eclipse.team.cvs.ui/plugin.properties | 3 ++
bundles/org.eclipse.team.cvs.ui/plugin.xml | 9 ++++++
.../ccvs/ui/subscriber/MergeUpdateAction.java | 9 +++++-
.../ui/subscriber/OverrideAndCommitAction.java | 37 ++++++++++++++++++++++
.../ccvs/ui/subscriber/SafeUpdateAction.java | 12 +++++--
.../ccvs/ui/subscriber/SubscriberCommitAction.java | 35 ++++----------------
.../ccvs/core/subscriber/TestCommitAction.java | 4 +--
.../core/subscriber/TestWorkspaceUpdateAction.java | 7 ++++
8 files changed, 81 insertions(+), 35 deletions(-)
create mode 100644 bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index f3bd06c43..5578d3cd7 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -175,6 +175,9 @@ CVSWorkspaceSubscriber.update.tooltip=Perform an update on the visible resources
CVSWorkspaceSubscriber.commit.label=&Commit
CVSWorkspaceSubscriber.commit.tooltip=Perform a commit on the visible resources
+CVSWorkspaceSubscriber.overcommit.label=&Override and Commit
+CVSWorkspaceSubscriber.overcommit.tooltip=Perform an override and commit on the visible resources. This will make the remote contents equal to the local.
+
CVSWorkspaceSubscriber.confirmMerged.label=&Mark as Merged
CVSWorkspaceSubscriber.confirmMerged.tooltip=Mark the conflict as merged by upgrading the base to match the remote
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 0df87f679..8994a5754 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -579,6 +579,15 @@
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.confirmMerged">
+
+
+
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;
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java
index f76ea0b46..e00269322 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java
@@ -11,10 +11,10 @@
package org.eclipse.team.tests.ccvs.core.subscriber;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction;
+import org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction;
import org.eclipse.team.ui.sync.SyncInfoSet;
-class TestCommitAction extends SubscriberCommitAction {
+class TestCommitAction extends OverrideAndCommitAction {
public IRunnableWithProgress getRunnable(SyncInfoSet syncSet) {
return super.getRunnable(syncSet);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestWorkspaceUpdateAction.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestWorkspaceUpdateAction.java
index ca9d8a169..33df73130 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestWorkspaceUpdateAction.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestWorkspaceUpdateAction.java
@@ -19,6 +19,13 @@ import org.eclipse.team.ui.sync.SyncInfoSet;
class TestWorkspaceUpdateAction extends WorkspaceUpdateAction {
boolean allowOverwrite = false;
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateAction#getOverwriteLocalChanges()
+ */
+ protected boolean getOverwriteLocalChanges() {
+ return allowOverwrite;
+ }
+
public TestWorkspaceUpdateAction(boolean allowOverwrite) {
this.allowOverwrite = allowOverwrite;
}
--
cgit v1.2.1