MergeSuperSet: Request mergeable field

This was not needed by MergeSuperSet specifically, but is required in
order to convert to ChangeInfo at the call site in SubmittedTogether.
Clarify the nearby comment.

Change-Id: I0b6d3ce52e5cd5d3b0f4e48a089fc28f720326bf
This commit is contained in:
Dave Borowitz
2016-09-12 10:41:55 -04:00
parent da3a8d32ca
commit 14183e0557

View File

@@ -78,6 +78,7 @@ public class MergeSuperSet {
for (ChangeData cd : cs.changes()) {
cd.reloadChange();
cd.setPatchSets(null);
cd.setMergeable(null);
}
}
@@ -316,13 +317,15 @@ public class MergeSuperSet {
}
private InternalChangeQuery query() {
// Request fields required for completing the ChangeSet without having to
// touch the database. This provides reasonable performance when loading the
// change screen; callers that care about reading the latest value of these
// fields should clear them explicitly using reloadChanges().
// Request fields required for completing the ChangeSet and converting to
// ChangeInfo without having to touch the database or opening the repository
// more than necessary. This provides reasonable performance when loading
// the change screen; callers that care about reading the latest value of
// these fields should clear them explicitly using reloadChanges().
Set<String> fields = ImmutableSet.of(
ChangeField.CHANGE.getName(),
ChangeField.PATCH_SET.getName());
ChangeField.PATCH_SET.getName(),
ChangeField.MERGEABLE.getName());
return queryProvider.get().setRequestedFields(fields);
}