Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-02-03 15:57:57 +0000
committerMichael Valenta2003-02-03 15:57:57 +0000
commit1d45a6b6666c843500e32dbfc1febd156e06a300 (patch)
treee410a2be5ce66615284ba80c19a4a93a5d126d4e
parentd7000d0ab555c889dedc63e11d579171e6fcf5c0 (diff)
downloadeclipse.platform.team-1d45a6b6666c843500e32dbfc1febd156e06a300.tar.gz
eclipse.platform.team-1d45a6b6666c843500e32dbfc1febd156e06a300.tar.xz
eclipse.platform.team-1d45a6b6666c843500e32dbfc1febd156e06a300.zip
25766: hen using IProjectSetSerializer existing repository is not re-used
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java
index 9e82cff3e..c42415988 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java
@@ -25,6 +25,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.IProjectSetSerializer;
import org.eclipse.team.core.RepositoryProvider;
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.ICVSFolder;
@@ -95,7 +97,7 @@ public class CVSProjectSetSerializer implements IProjectSetSerializer {
return null;
}
String repo = tokenizer.nextToken();
- locations[i] = CVSRepositoryLocation.fromString(repo);
+ locations[i] = getLocationFromString(repo);
modules[i] = tokenizer.nextToken();
String projectName = tokenizer.nextToken();
projects[i] = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
@@ -173,6 +175,25 @@ public class CVSProjectSetSerializer implements IProjectSetSerializer {
}
return (IProject[])result.toArray(new IProject[result.size()]);
}
+
+ private ICVSRepositoryLocation getLocationFromString(String repo) throws CVSException {
+ // create the new location
+ ICVSRepositoryLocation newLocation = CVSRepositoryLocation.fromString(repo);
+ if (newLocation.getUsername() == null || newLocation.getUsername().length() == 0) {
+ // look for an existing location that matched
+ ICVSRepositoryLocation[] locations = CVSProviderPlugin.getPlugin().getKnownRepositories();
+ for (int i = 0; i < locations.length; i++) {
+ ICVSRepositoryLocation location = locations[i];
+ if (location.getMethod() == newLocation.getMethod()
+ && location.getHost().equals(newLocation.getHost())
+ && location.getPort() == newLocation.getPort()
+ && location.getRootDirectory().equals(newLocation.getRootDirectory()))
+ return location;
+ }
+ }
+ return newLocation;
+ }
+
private int confirmOverwrite(IProject project, boolean yesToAll, Shell shell) {
if (yesToAll) return 2;
if (!project.exists()) return 0;

Back to the top