Add client API for /changes/<id>/revisions/<id>/files

This view exports the list of files modified by the commit.
Its structure is an object map keyed by file path.

Change-Id: I1b4b54dce4731dfd1dcc53d9d01eef1f2bda78b1
This commit is contained in:
Shawn Pearce
2013-07-08 13:01:59 -07:00
parent 1d67922088
commit 630dd1d7a5
3 changed files with 40 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.client.diff;
import com.google.gerrit.client.changes.ChangeApi;
import com.google.gerrit.client.rpc.NativeMap;
import com.google.gerrit.client.rpc.RestApi;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -24,6 +25,13 @@ public class DiffApi {
NONE, TRAILING, CHANGED, ALL;
};
public static void list(int id, String revision,
AsyncCallback<NativeMap<FileInfo>> cb) {
ChangeApi.revision(id, revision)
.view("files")
.get(NativeMap.copyKeysIntoChildren("path", cb));
}
public static DiffApi diff(PatchSet.Id id, String path) {
return new DiffApi(ChangeApi.revision(id)
.view("files").id(path)