in src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java [602:622]
private void abandonDownstream(ChangeInfo change, String revision)
throws ConfigInvalidException, StorageException {
try {
Set<String> downstreamBranches = config.getDownstreamBranches(change.branch, change.project);
if (downstreamBranches.isEmpty()) {
log.debug("Downstream branches of {} on {} are empty", change.branch, change.project);
return;
}
for (String downstreamBranch : downstreamBranches) {
List<Integer> existingDownstream =
getExistingMergesOnBranch(revision, change.topic, downstreamBranch);
log.debug("Abandoning existing downstreams: {}", existingDownstream);
for (Integer changeNumber : existingDownstream) {
abandonChange(changeNumber);
}
}
} catch (RestApiException | IOException | InvalidQueryParameterException e) {
log.error("Failed to abandon downstreams of {}", change.id, e);
}
}