// delete all versioned records
$this->deleteClones($commits, $versionContext, $versionId);
// release lock to ensure no other merge is running
$lock->release();
// dispatch events to trigger indexer and other subscribts
$writes = EntityWrittenContainerEvent::createWithWrittenEvents($result->getWritten(), $liveContext->getContext(), []);