Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-01-29 01:14:12 +0000
committerjames2002-01-29 01:14:12 +0000
commit94ec5d1006595c42b255b145df9e78bc86a4a9c0 (patch)
tree97f159591755210e24b2d100c4a5e0dbfd7383ce
parent12dc1726a5a54f7c252e120e86a7b373d69166a8 (diff)
downloadeclipse.platform.team-94ec5d1006595c42b255b145df9e78bc86a4a9c0.tar.gz
eclipse.platform.team-94ec5d1006595c42b255b145df9e78bc86a4a9c0.tar.xz
eclipse.platform.team-94ec5d1006595c42b255b145df9e78bc86a4a9c0.zip
8635: Created branches are not remembered
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java26
1 files changed, 21 insertions, 5 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
index cfbee3674..2b8c7d5d2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
@@ -22,11 +22,16 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
+import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.RepositoryManager;
+import org.eclipse.team.internal.ccvs.ui.model.BranchTag;
public class BranchWizard extends Wizard {
BranchWizardPage mainPage;
@@ -44,7 +49,7 @@ public class BranchWizard extends Wizard {
final boolean[] result = new boolean[] {false};
try {
getContainer().run(false, false, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
String tagString = mainPage.getBranchTag();
boolean update = mainPage.getUpdate();
@@ -55,6 +60,7 @@ public class BranchWizard extends Wizard {
}
// To do: use the wizard's progress monitor
+ RepositoryManager manager = CVSUIPlugin.getPlugin().getRepositoryManager();
Hashtable table = getProviderMapping(resources);
Set keySet = table.keySet();
monitor.beginTask("", keySet.size() * 1000);
@@ -65,14 +71,20 @@ public class BranchWizard extends Wizard {
CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
List list = (List)table.get(provider);
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
+ ICVSRepositoryLocation root = provider.getRemoteRoot();
CVSTag tag = new CVSTag(tagString, CVSTag.BRANCH);
try {
- if (versionString != null) {
+ if (versionTag != null) {
provider.tag(providerResources, IResource.DEPTH_INFINITE, versionTag, subMonitor);
+ for (int i = 0; i < providerResources.length; i++) {
+ ICVSRemoteFolder remoteResource = (ICVSRemoteFolder)provider.getRemoteResource(providerResources[i]);
+ manager.addVersionTags(remoteResource, new CVSTag[] { versionTag });
+ }
}
provider.tag(providerResources, IResource.DEPTH_INFINITE, tag, subMonitor);
if (update) {
provider.update(providerResources, IResource.DEPTH_INFINITE, tag, true, subMonitor);
+ manager.addBranchTags(root, new BranchTag[] { new BranchTag(tag, root) });
}
} catch (TeamException e) {
status.merge(e.getStatus());
@@ -81,7 +93,9 @@ public class BranchWizard extends Wizard {
if (!status.isOK()) {
ErrorDialog.openError(getShell(), null, null, status);
}
- result[0] = true;
+ result[0] = true;
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
} finally {
monitor.done();
}
@@ -90,9 +104,11 @@ public class BranchWizard extends Wizard {
} catch (InterruptedException e) {
return true;
} catch (InvocationTargetException e) {
- // no exceptions are explicitly thrown by the above runnable
- // pass through runtime exceptions to catch coding errors
Throwable target = e.getTargetException();
+ if (target instanceof CVSException) {
+ ErrorDialog.openError(getShell(), null, null, ((CVSException)target).getStatus());
+ return false;
+ }
if (target instanceof RuntimeException) {
throw (RuntimeException)target;
}

Back to the top