Merge "SideBySide2: Respect base diff revision for files REST call"
This commit is contained in:
@@ -35,6 +35,15 @@ public class DiffApi {
|
||||
api.get(NativeMap.copyKeysIntoChildren("path", cb));
|
||||
}
|
||||
|
||||
public static void list(PatchSet.Id id, PatchSet.Id base,
|
||||
AsyncCallback<NativeMap<FileInfo>> cb) {
|
||||
RestApi api = ChangeApi.revision(id).view("files");
|
||||
if (base != null) {
|
||||
api.addParameter("base", base.get());
|
||||
}
|
||||
api.get(NativeMap.copyKeysIntoChildren("path", cb));
|
||||
}
|
||||
|
||||
public static DiffApi diff(PatchSet.Id id, String path) {
|
||||
return new DiffApi(ChangeApi.revision(id)
|
||||
.view("files").id(path)
|
||||
|
||||
@@ -129,11 +129,9 @@ class Header extends Composite {
|
||||
|
||||
@Override
|
||||
protected void onLoad() {
|
||||
ChangeApi.revision(patchSetId).view("files").get(
|
||||
new GerritCallback<NativeMap<FileInfo>>() {
|
||||
DiffApi.list(patchSetId, base, new GerritCallback<NativeMap<FileInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(NativeMap<FileInfo> result) {
|
||||
result.copyKeysIntoChildren("path");
|
||||
JsArray<FileInfo> files = result.values();
|
||||
FileInfo.sortFileInfoByPath(files);
|
||||
int index = 0; // TODO: Maybe use patchIndex.
|
||||
|
||||
Reference in New Issue
Block a user