Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-05-12 17:48:30 +0000
committerMichael Valenta2004-05-12 17:48:30 +0000
commit37fc2a0eb31f23f439fea7f217c94bc664417cdf (patch)
tree3d4be7b79affc491688ee65c65eb070c678124fd
parente5b1ad326839d9ba3b53c42ea1b18f7c79b7de06 (diff)
downloadeclipse.platform.team-37fc2a0eb31f23f439fea7f217c94bc664417cdf.tar.gz
eclipse.platform.team-37fc2a0eb31f23f439fea7f217c94bc664417cdf.tar.xz
eclipse.platform.team-37fc2a0eb31f23f439fea7f217c94bc664417cdf.zip
Bug 57002: Branching with incoming changes
Bug 53399: [CVS Sync View] branching doesn't cause label updates in the sync view
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java24
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch6
2 files changed, 23 insertions, 7 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java
index 05df19b62..3ae7c07d5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java
@@ -19,8 +19,10 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.internal.ccvs.core.CVSWorkspaceSubscriber;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
@@ -97,15 +99,21 @@ public class BranchOperation extends RepositoryProviderOperation {
*/
protected void execute(CVSTeamProvider provider, IResource[] providerResources, IProgressMonitor monitor) throws CVSException, InterruptedException {
try {
- makeBranch(provider, providerResources, rootVersionTag, branchTag, update, monitor);
- updateRememberedags(providerResources);
+ monitor.beginTask(null, 100);
+ makeBranch(provider, providerResources, rootVersionTag, branchTag, update, Policy.subMonitorFor(monitor, 90));
+ updateRememberedTags(providerResources);
+ if (update) {
+ updateWorkspaceSubscriber(provider, Policy.subMonitorFor(monitor, 10));
+ }
collectStatus(Status.OK_STATUS);
} catch (TeamException e) {
// Accumulate the status which will be displayed by CVSAction#endOperation(IAction)
collectStatus(e.getStatus());
+ } finally {
+ monitor.done();
}
}
-
+
private void makeBranch(CVSTeamProvider provider, IResource[] resources, final CVSTag versionTag, final CVSTag branchTag, boolean moveToBranch, IProgressMonitor monitor) throws TeamException {
// Determine the total amount of work
@@ -226,7 +234,7 @@ public class BranchOperation extends RepositoryProviderOperation {
}, monitor);
}
- private void updateRememberedags(IResource[] providerResources) throws CVSException {
+ private void updateRememberedTags(IResource[] providerResources) throws CVSException {
if (rootVersionTag != null || update) {
for (int i = 0; i < providerResources.length; i++) {
ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(providerResources[i]);
@@ -242,6 +250,14 @@ public class BranchOperation extends RepositoryProviderOperation {
}
}
+ /*
+ * Update the workspace subscriber by flushin any cahced remote bytes
+ */
+ private void updateWorkspaceSubscriber(CVSTeamProvider provider, IProgressMonitor monitor) throws TeamException {
+ CVSWorkspaceSubscriber s = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
+ s.updateRemote(provider, monitor);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
diff --git a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch
index f7449185a..abc381468 100644
--- a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch
+++ b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/One CVS Test.launch
@@ -2,13 +2,13 @@
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<booleanAttribute key="clearws" value="true"/>
<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.subscriber.CVSWorkspaceSubscriberTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.subscriber.CVSMergeSubscriberTest"/>
<booleanAttribute key="tracing" value="false"/>
<stringAttribute key="location1" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/>
+<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName=testIncomingChanges"/>
<booleanAttribute key="default" value="true"/>
-<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAddedToBranch"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="clearConfig" value="true"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>

Back to the top