forked from mirrors/jj
f1666375bd
I want to keep the index updated within the transaction. I tried doing that by adding a `trait Index`, implemented by `ReadonlyIndex` and `MutableIndex`. However, `ReadonlyRepo::index` is of type `Mutex<Option<Arc<IndexFile>>>` (because it is lazily initialized), and we cannot get a `&dyn Index` that lives long enough to be returned from a `Repo::index()` from that. It seems the best solution is to instead create an `Index` enum (instead of a trait), with one readonly and one mutable variant. This commit starts the migration to that design by replacing the `Repo` trait by an enum. I never intended for there there to be more implementations of `Repo` than `ReadonlyRepo` and `MutableRepo` anyway. |
||
---|---|---|
.. | ||
test_bad_locking.rs | ||
test_commit_builder.rs | ||
test_commit_concurrent.rs | ||
test_diff_summary.rs | ||
test_evolution.rs | ||
test_git.rs | ||
test_index.rs | ||
test_init.rs | ||
test_load_repo.rs | ||
test_merge_trees.rs | ||
test_operations.rs | ||
test_transaction.rs | ||
test_view.rs | ||
test_working_copy.rs | ||
test_working_copy_concurrent.rs |