Reconcile retained history accounting
This commit is contained in:
@@ -85,6 +85,12 @@ func cloneInheritanceTransfer(transfer inheritanceTransfer) inheritanceTransfer
|
||||
}
|
||||
|
||||
func cloneInheritanceOperations(operations []inheritanceOperation) []inheritanceOperation {
|
||||
return copyInheritanceOperations(operations, true)
|
||||
}
|
||||
|
||||
// copyInheritanceOperations detaches mutable operation metadata. History keeps
|
||||
// the already immutable engine-owned document roots rather than copying them.
|
||||
func copyInheritanceOperations(operations []inheritanceOperation, cloneDocuments bool) []inheritanceOperation {
|
||||
if operations == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -101,8 +107,12 @@ func cloneInheritanceOperations(operations []inheritanceOperation) []inheritance
|
||||
transfer := cloneInheritanceTransfer(*operation.transfer)
|
||||
cloned[index].transfer = &transfer
|
||||
}
|
||||
cloned[index].parent = document.Clone(operation.parent)
|
||||
cloned[index].effective = document.Clone(operation.effective)
|
||||
cloned[index].parent = operation.parent
|
||||
cloned[index].effective = operation.effective
|
||||
if cloneDocuments {
|
||||
cloned[index].parent = document.Clone(operation.parent)
|
||||
cloned[index].effective = document.Clone(operation.effective)
|
||||
}
|
||||
cloned[index].childOrigins = cloneOriginIndex(operation.childOrigins)
|
||||
cloned[index].parentOrigins = cloneOriginIndex(operation.parentOrigins)
|
||||
cloned[index].effectiveOrigins = cloneOriginIndex(operation.effectiveOrigins)
|
||||
|
||||
Reference in New Issue
Block a user