Skip to content

Commit

Permalink
Make sure bulk:deprecate and bulk:keep does not point to the same res…
Browse files Browse the repository at this point in the history
…ource
  • Loading branch information
kwahlin committed Nov 20, 2024
1 parent 73c4b79 commit c267cc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions whelktool/src/main/resources/bulk-change-scripts/merge.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if (!deprecateId || !keepId) return
List<String> obsoleteThingUris = []

selectByIds([deprecateId]) { obsolete ->
// Assert that the resource to deprecate is not the same as the one to be kept
if (obsolete.doc.getThingIdentifiers().first() == keepId) {
return
}

obsoleteThingUris = obsolete.doc.getThingIdentifiers()

selectByIds(obsolete.getDependers()) { depender ->
Expand Down

0 comments on commit c267cc2

Please sign in to comment.