ca.neededBy = new ArrayList<DependencyAttribute>();
try {
final ReviewDb db = schema.open();
try {
final PatchSet.Id psId = change.currentPatchSetId();
for (PatchSetAncestor a : db.patchSetAncestors().ancestorsOf(psId)) {
for (PatchSet p :
db.patchSets().byRevision(a.getAncestorRevision())) {
Change c = db.changes().get(p.getId().getParentKey());
ca.dependsOn.add(newDependsOn(c, p));
}