Methods Summary |
---|
public void | execute()the execute method running CvsVersion
ByteArrayOutputStream bos = new ByteArrayOutputStream();
this.setOutputStream(bos);
ByteArrayOutputStream berr = new ByteArrayOutputStream();
this.setErrorStream(berr);
setCommand("version");
super.execute();
String output = bos.toString();
StringTokenizer st = new StringTokenizer(output);
boolean client = false;
boolean server = false;
boolean cvs = false;
while (st.hasMoreTokens()) {
String currentToken = st.nextToken();
if (currentToken.equals("Client:")) {
client = true;
} else if (currentToken.equals("Server:")) {
server = true;
} else if (currentToken.equals("(CVS)")) {
cvs = true;
}
if (client && cvs) {
if (st.hasMoreTokens()) {
clientVersion = st.nextToken();
}
client = false;
cvs = false;
} else if (server && cvs) {
if (st.hasMoreTokens()) {
serverVersion = st.nextToken();
}
server = false;
cvs = false;
}
}
if (clientVersionProperty != null) {
getProject().setNewProperty(clientVersionProperty, clientVersion);
}
if (serverVersionProperty != null) {
getProject().setNewProperty(serverVersionProperty, serverVersion);
}
|
public java.lang.String | getClientVersion()Get the CVS client version
return clientVersion;
|
public java.lang.String | getServerVersion()Get the CVS server version
return serverVersion;
|
public void | setClientVersionProperty(java.lang.String clientVersionProperty)Set a property where to store the CVS client version
this.clientVersionProperty = clientVersionProperty;
|
public void | setServerVersionProperty(java.lang.String serverVersionProperty)Set a property where to store the CVS server version
this.serverVersionProperty = serverVersionProperty;
|
public boolean | supportsCvsLogWithSOption()Find out if the server version supports log with S option
if (serverVersion == null) {
return false;
}
StringTokenizer tokenizer = new StringTokenizer(serverVersion, ".");
long counter = MULTIPLY * MULTIPLY;
long version = 0;
while (tokenizer.hasMoreTokens()) {
String s = tokenizer.nextToken();
int i = 0;
for (i = 0; i < s.length(); i++) {
if (!Character.isDigit(s.charAt(i))) {
break;
}
}
String s2 = s.substring(0, i);
version = version + counter * Long.parseLong(s2);
if (counter == 1) {
break;
}
counter = counter / MULTIPLY;
}
return (version >= VERSION_1_11_2);
|