Explain descendants removed by sequence replacement

This commit is contained in:
2026-10-17 04:45:49 +00:00
parent 26720b98f0
commit 8a89806e44
3 changed files with 46 additions and 2 deletions

View File

@@ -139,7 +139,15 @@ func applicationOperationPath(application historyApplication, query Path, lookup
}
sequencePathMatched = true
if pathContains(container, query) && len(query.segments) > len(container.segments) {
if _, ok := historyApplicationLocalPath(application, query); !ok {
local, ok := historyApplicationLocalPath(application, query)
if contribution.mode == sequenceHistoryReplace {
if _, present := documentAtPathWithLookup(application.value, local, lookup); !ok || !present {
// A replacement also changes descendants missing from the
// incoming list. Attribute their removal to its container.
return container, true
}
}
if !ok {
continue
}
}