use of org.eclipse.che.plugin.svn.shared.CLIOutputWithRevisionResponse in project che by eclipse.
the class CommitPresenter method doCommit.
private void doCommit(String message, Path[] paths, boolean keepLocks) {
final Project project = appContext.getRootProject();
checkState(project != null);
service.commit(project.getLocation(), paths, message, false, keepLocks).then(new Operation<CLIOutputWithRevisionResponse>() {
@Override
public void apply(CLIOutputWithRevisionResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), response.getErrOutput(), constants.commandCommit());
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
final StatusNotification notification = new StatusNotification(error.getMessage(), FAIL, FLOAT_MODE);
notificationManager.notify(notification);
}
});
view.onClose();
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputWithRevisionResponse in project che by eclipse.
the class SubversionClientServiceImpl method commit.
@Override
public Promise<CLIOutputWithRevisionResponse> commit(Path project, Path[] paths, String message, boolean keepChangeLists, boolean keepLocks) {
final String url = getBaseUrl() + "/commit";
final CommitRequest request = dtoFactory.createDto(CommitRequest.class).withPaths(toList(paths)).withMessage(message).withProjectPath(project.toString()).withKeepChangeLists(keepChangeLists).withKeepLocks(keepLocks);
return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputWithRevisionResponse.class));
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputWithRevisionResponse in project che by eclipse.
the class SubversionApiITest method testCheckout.
/**
* Tests for {@link SubversionApi#checkout(CheckoutRequest)}.
*
* @throws Exception
* if anything goes wrong
*/
@Test
public void testCheckout() throws Exception {
CLIOutputWithRevisionResponse response = this.subversionApi.checkout(DtoFactory.getInstance().createDto(CheckoutRequest.class).withProjectPath(tmpDir.toFile().getAbsolutePath()).withUrl(repoUrl));
assertTrue(response.getRevision() > -1);
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputWithRevisionResponse in project che by eclipse.
the class SubversionApiITest method testUpdate.
/**
* Tests for {@link SubversionApi#update(UpdateRequest)}.
*
* @throws Exception
* if anything goes wrong
*/
@Test
public void testUpdate() throws Exception {
final long coRevision = this.subversionApi.checkout(DtoFactory.getInstance().createDto(CheckoutRequest.class).withProjectPath(tmpDir.toFile().getAbsolutePath()).withUrl(repoUrl).withDepth("immediates")).getRevision();
final CLIOutputWithRevisionResponse response = this.subversionApi.update(DtoFactory.getInstance().createDto(UpdateRequest.class).withProjectPath(tmpDir.toFile().getAbsolutePath()));
assertTrue(coRevision > -1);
assertTrue(response.getRevision() > -1);
assertTrue(coRevision <= response.getRevision());
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputWithRevisionResponse in project che by eclipse.
the class SubversionApiITest method testSwitchToTag.
@Test
public void testSwitchToTag() throws Exception {
subversionApi.checkout(DtoFactory.getInstance().createDto(CheckoutRequest.class).withProjectPath(tmpDir.toFile().getAbsolutePath()).withUrl(repoUrl + "/trunk"));
CLIOutputWithRevisionResponse response = this.subversionApi.doSwitch(DtoFactory.getInstance().createDto(SwitchRequest.class).withProjectPath(tmpDir.toFile().getAbsolutePath()).withLocation("^/tags/1.0").withIgnoreAncestry(true));
assertTrue(response.getRevision() > -1);
}
Aggregations