Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repo: use Transaction for creating repo-init operation
Since the operation log has a root operation, we don't need to create the repo-initialization operation in order to create a valid `ReadonlyRepo` instance. I think it's conceptually simpler to create the instance at the root operation id and then add the initial operation using the usual `Transaction` API. That's what this patch does. Doing that also brought two issues to light: 1. The empty view object doesn't have the root commit as head. 2. The initialized `OpHeadsStore` doesn't have the root operation as head. Both of those seem somewhat reasonable, but maybe we should change them. For now, I just made the initial repo (before the initial operation) have a single op head (to compensate for (2)). It might be worth addressing both issues so the repo is in a better state before we create the initial operation. Until we do, we probably shouldn't drop the initial operation.
- Loading branch information