Search in sources :

Example 1 with CommitRequest

use of org.eclipse.che.api.git.shared.CommitRequest in project che by eclipse.

the class GitServiceClientImpl method commit.

@Override
public void commit(DevMachine devMachine, ProjectConfig project, String message, boolean all, boolean amend, AsyncRequestCallback<Revision> callback) {
    CommitRequest commitRequest = dtoFactory.createDto(CommitRequest.class).withMessage(message).withAmend(amend).withAll(all);
    String url = appContext.getDevMachine().getWsAgentBaseUrl() + COMMIT + "?projectPath=" + project.getPath();
    asyncRequestFactory.createPostRequest(url, commitRequest).loader(loader).send(callback);
}
Also used : CommitRequest(org.eclipse.che.api.git.shared.CommitRequest)

Example 2 with CommitRequest

use of org.eclipse.che.api.git.shared.CommitRequest in project che by eclipse.

the class GitServiceClientImpl method commit.

@Override
public Promise<Revision> commit(DevMachine devMachine, Path project, String message, boolean all, Path[] files, boolean amend) {
    List<String> paths = new ArrayList<>(files.length);
    for (Path file : files) {
        if (!file.isEmpty()) {
            paths.add(file.toString());
        }
    }
    CommitRequest commitRequest = dtoFactory.createDto(CommitRequest.class).withMessage(message).withAmend(amend).withAll(all).withFiles(paths);
    String url = devMachine.getWsAgentBaseUrl() + COMMIT + "?projectPath=" + project;
    return asyncRequestFactory.createPostRequest(url, commitRequest).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(Revision.class));
}
Also used : Path(org.eclipse.che.ide.resource.Path) CommitRequest(org.eclipse.che.api.git.shared.CommitRequest) Revision(org.eclipse.che.api.git.shared.Revision) ArrayList(java.util.ArrayList)

Example 3 with CommitRequest

use of org.eclipse.che.api.git.shared.CommitRequest in project che by eclipse.

the class GitServiceClientImpl method commit.

@Override
public void commit(final DevMachine devMachine, final ProjectConfigDto project, final String message, final List<String> files, final boolean amend, final AsyncRequestCallback<Revision> callback) {
    CommitRequest commitRequest = dtoFactory.createDto(CommitRequest.class).withMessage(message).withAmend(amend).withAll(false).withFiles(files);
    String url = appContext.getDevMachine().getWsAgentBaseUrl() + COMMIT + "?projectPath=" + project.getPath();
    asyncRequestFactory.createPostRequest(url, commitRequest).loader(loader).send(callback);
}
Also used : CommitRequest(org.eclipse.che.api.git.shared.CommitRequest)

Example 4 with CommitRequest

use of org.eclipse.che.api.git.shared.CommitRequest in project che by eclipse.

the class GitServiceClientImpl method commit.

@Override
public Promise<Revision> commit(DevMachine devMachine, Path project, String message, boolean all, boolean amend) {
    CommitRequest commitRequest = dtoFactory.createDto(CommitRequest.class).withMessage(message).withAmend(amend).withAll(all);
    String url = devMachine.getWsAgentBaseUrl() + COMMIT + "?projectPath=" + project;
    return asyncRequestFactory.createPostRequest(url, commitRequest).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(Revision.class));
}
Also used : CommitRequest(org.eclipse.che.api.git.shared.CommitRequest) Revision(org.eclipse.che.api.git.shared.Revision)

Aggregations

CommitRequest (org.eclipse.che.api.git.shared.CommitRequest)4 Revision (org.eclipse.che.api.git.shared.Revision)2 ArrayList (java.util.ArrayList)1 Path (org.eclipse.che.ide.resource.Path)1