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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user