use of org.eclipse.che.plugin.svn.shared.GetRevisionsRequest in project che by eclipse.
the class SubversionApi method getRevisions.
public GetRevisionsResponse getRevisions(GetRevisionsRequest request) throws IOException, SubversionException, UnauthorizedException {
final File projectPath = new File(request.getProjectPath());
final List<String> uArgs = defaultArgs();
addOption(uArgs, "--revision", request.getRevisionRange());
uArgs.add("log");
final CommandLineResult result = runCommand(null, uArgs, projectPath, Arrays.asList(request.getPath()));
final GetRevisionsResponse response = DtoFactory.getInstance().createDto(GetRevisionsResponse.class).withCommand(result.getCommandLine().toString()).withOutput(result.getStdout()).withErrOutput(result.getStderr());
if (result.getExitCode() == 0) {
List<String> revisions = result.getStdout().parallelStream().filter(line -> line.split("\\|").length == 4).map(line -> line.split("\\|")[0].trim()).collect(Collectors.toList());
response.withRevisions(revisions);
}
return response;
}
Aggregations