diff --git a/whelktool/src/main/resources/bulk-change-scripts/merge.groovy b/whelktool/src/main/resources/bulk-change-scripts/merge.groovy index 8a4fa40dbe..c4a96bc897 100644 --- a/whelktool/src/main/resources/bulk-change-scripts/merge.groovy +++ b/whelktool/src/main/resources/bulk-change-scripts/merge.groovy @@ -16,6 +16,11 @@ if (!deprecateId || !keepId) return List 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 ->