use of org.eclipse.che.plugin.svn.shared.CLIOutputResponseList in project che by eclipse.
the class SubversionClientServiceImpl method resolve.
@Override
public Promise<CLIOutputResponseList> resolve(Path project, Map<String, String> resolutions, String depth) {
final String url = getBaseUrl() + "/resolve";
final ResolveRequest request = dtoFactory.createDto(ResolveRequest.class).withProjectPath(project.toString()).withConflictResolutions(resolutions).withDepth(depth);
return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponseList.class));
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponseList in project che by eclipse.
the class ResolvePresenter method onResolveClicked.
@Override
public void onResolveClicked() {
final Project project = appContext.getRootProject();
checkState(project != null);
HashMap<String, String> filesConflictResolutionActions = new HashMap<String, String>();
Iterator<String> iterConflicts = conflictsList.iterator();
while (iterConflicts.hasNext()) {
String path = iterConflicts.next();
String resolutionActionText = view.getConflictResolutionAction(path);
if (!resolutionActionText.equals(ConflictResolutionAction.POSTPONE.getText())) {
filesConflictResolutionActions.put(path, resolutionActionText);
iterConflicts.remove();
}
}
if (filesConflictResolutionActions.size() > 0) {
service.resolve(project.getLocation(), filesConflictResolutionActions, "infinity").then(new Operation<CLIOutputResponseList>() {
@Override
public void apply(CLIOutputResponseList response) throws OperationException {
for (CLIOutputResponse outputResponse : response.getCLIOutputResponses()) {
printResponse(outputResponse.getCommand(), outputResponse.getOutput(), null, constants.commandResolve());
}
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notificationManager.notify(error.getMessage(), FAIL, FLOAT_MODE);
}
});
}
view.close();
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponseList in project che by eclipse.
the class SubversionApi method resolve.
/**
* Perform an "svn resolve" based on the request.
*
* @param request
* the request
* @return the response
* @throws IOException
* if there is a problem executing the command
* @throws SubversionException
* if there is a Subversion issue
*/
public CLIOutputResponseList resolve(final ResolveRequest request) throws IOException, SubversionException, UnauthorizedException {
final File projectPath = new File(request.getProjectPath());
Map<String, String> resolutions = request.getConflictResolutions();
List<CLIOutputResponse> results = new ArrayList<>();
for (String path : resolutions.keySet()) {
final List<String> uArgs = defaultArgs();
addDepth(uArgs, request.getDepth());
addOption(uArgs, "--accept", resolutions.get(path));
uArgs.add("resolve");
final CommandLineResult result = runCommand(null, uArgs, projectPath, Arrays.asList(path));
CLIOutputResponse outputResponse = DtoFactory.getInstance().createDto(CLIOutputResponse.class).withCommand(result.getCommandLine().toString()).withOutput(result.getStdout()).withErrOutput(result.getStderr());
results.add(outputResponse);
}
return DtoFactory.getInstance().createDto(CLIOutputResponseList.class).withCLIOutputResponses(results);
}
Aggregations