Skip to content

Commit

Permalink
Fix bulk:deprecate not being excluded from relinking
Browse files Browse the repository at this point in the history
  • Loading branch information
kwahlin committed Dec 12, 2024
1 parent 7638f76 commit 6fe0c7a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions whelktool/src/main/resources/bulk-change-scripts/merge.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ selectByIds(dependsOnObsolete) { depender ->
def modified = DocumentUtil.traverse(depender.graph) { value, path ->
// TODO: What if there are links to a record uri?
if (path && path.last() == ID_KEY && obsoleteThingUris.contains(value)) {
path.dropRight(1).with {
if (it.last() == DEPRECATE_KEY) {
return
}
if (it.last() instanceof Integer) {
modifiedListPaths.add(it.dropRight(1))
def pathToLink = path.dropRight(1)
if (pathToLink.last() != DEPRECATE_KEY) {
if (pathToLink.last() instanceof Integer) {
modifiedListPaths.add(pathToLink.dropRight(1))
}
return new DocumentUtil.Replace(keepId)
}
return new DocumentUtil.Replace(keepId)
}
}
// Remove duplicates
Expand Down

0 comments on commit 6fe0c7a

Please sign in to comment.