use of org.suigeneris.jrcs.rcs.InvalidVersionNumberException in project OpenGrok by OpenGrok.
the class BitKeeperRepository method ensureVersion.
/**
* Updates working and version member variables by running {@code bk --version}.
*/
private void ensureVersion() {
if (working == null) {
ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
final Executor exec = new Executor(new String[] { RepoCommand, "--version" });
if (exec.exec(false) == 0) {
working = Boolean.TRUE;
final Matcher matcher = VERSION_PATTERN.matcher(exec.getOutputString());
if (matcher.find()) {
try {
version = new Version(matcher.group(1));
} catch (final InvalidVersionNumberException e) {
assert false : "Failed to parse a version number.";
}
}
} else {
working = Boolean.FALSE;
}
if (version == null) {
version = new Version(0, 0);
}
}
}
Aggregations