diff options
author | Michael Valenta | 2005-10-04 17:10:34 +0000 |
---|---|---|
committer | Michael Valenta | 2005-10-04 17:10:34 +0000 |
commit | 95a8987d669dcd860a63a17412d10afba7ed8fa9 (patch) | |
tree | db513660bfb650672d695be6b8c03e425d32787a | |
parent | 17b8de56f7e437d232dfd49b34f65895d3274ee3 (diff) | |
download | eclipse.platform.team-branch_20050930_EFS.tar.gz eclipse.platform.team-branch_20050930_EFS.tar.xz eclipse.platform.team-branch_20050930_EFS.zip |
Changed URI to a better looking formatbranch_20050930_EFS
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java index 6270c8a4d..fc27d0468 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java @@ -22,7 +22,6 @@ import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; -import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag; import org.eclipse.team.internal.ccvs.core.resources.RemoteFile; import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder; @@ -46,26 +45,29 @@ public class CVSURI { } private static CVSTag getTag(URI uri) { -// String f = uri.getFragment(); -// int i = f.indexOf(','); -// if (i == -1) { + String f = uri.getFragment(); + int i = f.indexOf(','); + if (i == -1) { return CVSTag.DEFAULT; -// } -// String name = f.substring(i + 1); -// return new CVSTag(name, CVSTag.BRANCH); + } + String name = f.substring(i + 1); + return new CVSTag(name, CVSTag.BRANCH); } private static IPath getPath(URI uri) { - String path = uri.getPath(); -// int i = path.indexOf(','); -// if (i != -1) { -// path = path.substring(0, i); -// } + String path = uri.getFragment(); + int i = path.indexOf(','); + if (i != -1) { + path = path.substring(0, i); + } return new Path(path); } private static ICVSRepositoryLocation getRepository(URI uri) throws CVSException { - String ssp = uri.getFragment(); + String ssp = uri.getSchemeSpecificPart(); + if (!ssp.startsWith(":")) { + ssp = ":" + ssp; + } return CVSRepositoryLocation.fromString(ssp); } @@ -90,10 +92,10 @@ public class CVSURI { public URI toURI() { try { String fragment = path.toString(); -// if (tag != null && tag.getType() != CVSTag.HEAD) { -// fragment += ","+tag.getName(); -// } - return new URI(SCHEME, repository.getHost(), fragment, repository.getLocation(false)); + if (tag != null && tag.getType() != CVSTag.HEAD) { + fragment += ","+tag.getName(); + } + return new URI(SCHEME, repository.getLocation(false), fragment); } catch (URISyntaxException e) { throw new Error(e.getMessage()); } |