SideBySide2: Respect base diff revision for files REST call
2d2a3c405eadded diff against to CS2.eaeb9ad104made diff against revision persistent. Both changes missed to pass base revision parameter in files REST call for navigation links rendering. Bug: issue 2417 Change-Id: I85a9bf23417f77d4cc4aab230efc1d4c9cd75a46
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