An Atomic repository. The Repository struct is the main entry point for all VCS operations. It manages the repository's pristine (database), changes directory, working copy, and configuration. # Components - **Pristine**: The graph database storing all version control data - **ChangeStore**: Content-addressed storage for change files - **Working Copy**: The actual files in the repository (futur
| 376 | /// [`ChangeStore`]. For concurrent access, use separate `Repository` |
| 377 | /// instances or wrap in appropriate synchronization primitives. |
| 378 | pub struct Repository { |
| 379 | /// Root path of the repository (contains .atomic/) |
| 380 | root: PathBuf, |
| 381 | /// Path to the .atomic directory |
| 382 | dot_dir: PathBuf, |
| 383 | /// Current view name |
| 384 | current_view: String, |
| 385 | /// The pristine database handle. |
| 386 | /// |
| 387 | /// Wrapped in `Arc` so that multiple `Repository` instances _can_ |
| 388 | /// share the same underlying redb `Database` and avoid stale-snapshot |
| 389 | /// bugs. In practice, sharing only happens when constructing via |
| 390 | /// `open_with_pristine`; `open` / `open_readonly` create a fresh |
| 391 | /// `Pristine` for each `Repository`. |
| 392 | pristine: Arc<Pristine>, |
| 393 | /// The filesystem change store for persisting canonical `.change` files. |
| 394 | change_store: ChangeStore, |
| 395 | /// Whether this handle was opened for an agent sandbox (via |
| 396 | /// [`Repository::open_sandbox`]). A sandbox's `dot_dir`/`pristine`/ |
| 397 | /// `change_store` point at the canonical repository while `current_view` |
| 398 | /// holds the sandbox's view (from its pointer file); it must not repoint |
| 399 | /// the canonical `current_view` on disk. |
| 400 | is_sandbox: bool, |
| 401 | /// Per-process memo of the CRDT branch state folded per trunk over the |
| 402 | /// current assembly closure; see [`semantic_closure::SemanticClosureMemo`]. |
| 403 | semantic_closure_memo: std::sync::Mutex<semantic_closure::SemanticClosureMemo>, |
| 404 | } |
| 405 | |
| 406 | impl std::fmt::Debug for Repository { |
| 407 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
no outgoing calls