final RevId id = new RevId(patchIdentity);
final ResultSet<PatchSet> patches;
if (id.isComplete()) {
patches = db.patchSets().byRevision(id);
} else {
patches = db.patchSets().byRevisionRange(id, id.max());
}
final Set<PatchSet.Id> matches = new HashSet<PatchSet.Id>();
for (final PatchSet ps : patches) {
final Change change = db.changes().get(ps.getId().getParentKey());