Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-10-20 17:15:19 +0000
committerMichael Valenta2003-10-20 17:15:19 +0000
commit304672e0ec7b874495c19655c1b02cd5a7fe5591 (patch)
treeb52f948d029d19434a44fa24789e9a1afc6bda16
parentba16ed7a822d8bb3ea16e842f60ea06bfcc0ca77 (diff)
downloadeclipse.platform.team-304672e0ec7b874495c19655c1b02cd5a7fe5591.tar.gz
eclipse.platform.team-304672e0ec7b874495c19655c1b02cd5a7fe5591.tar.xz
eclipse.platform.team-304672e0ec7b874495c19655c1b02cd5a7fe5591.zip
45138: Eclipse doesn't work with cvs server version 1.11.9
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java33
1 files changed, 30 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
index 6bca062ff..6d0e4caf1 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
@@ -687,7 +687,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
partId = "CVSRepositoryLocation.parsingUser";//$NON-NLS-1$
end = location.indexOf(HOST_SEPARATOR, start);
- String user = null;;
+ String user = null;
String password = null;
// if end is -1 then there is no host separator meaning that the username is not present
if (end != -1) {
@@ -954,8 +954,35 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
if(firstSpace != -1) {
// remove the program name and the space
message = message.substring(firstSpace + 1);
- if (message.startsWith(prefix)) {
- message = message.substring(prefix.length());
+ // Quick fix to handle changes in server message format (see Bug 45138)
+ if (prefix.startsWith("[")) {
+ // This is the server aborted message
+ // Remove the pattern "[command_name aborted]: "
+ int closingBracket = message.indexOf("]: ");
+ if (closingBracket == -1) return null;
+ // get what is inside the brackets
+ String realPrefix = message.substring(1, closingBracket);
+ // check that there is two words and the second word is "aborted"
+ int space = realPrefix.indexOf(' ');
+ if (space == -1) return null;
+ if (realPrefix.indexOf(' ', space +1) != -1) return null;
+ if (!realPrefix.substring(space +1).equals("aborted")) return null;
+ // It's a match, return the rest of the line
+ message = message.substring(closingBracket + 2);
+ if (message.charAt(0) == ' ') {
+ message = message.substring(1);
+ }
+ return message;
+ } else {
+ // This is the server command message
+ // Remove the pattern "command_name: "
+ int colon = message.indexOf(": ");
+ if (colon == -1) return null;
+ // get what is before the colon
+ String realPrefix = message.substring(0, colon);
+ // ensure that it is a single word
+ if (realPrefix.indexOf(' ') != -1) return null;
+ message = message.substring(colon + 1);
if (message.charAt(0) == ' ') {
message = message.substring(1);
}

Back to the top