MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / Repository

Class Repository

atomic-repository/src/repository/mod.rs:391–417  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

389/// [`ChangeStore`]. For concurrent access, use separate `Repository`
390/// instances or wrap in appropriate synchronization primitives.
391pub struct Repository {
392 /// Root path of the repository (contains .atomic/)
393 root: PathBuf,
394 /// Path to the .atomic directory
395 dot_dir: PathBuf,
396 /// Current view name
397 current_view: String,
398 /// The pristine database handle.
399 ///
400 /// Wrapped in `Arc` so that multiple `Repository` instances _can_
401 /// share the same underlying redb `Database` and avoid stale-snapshot
402 /// bugs. In practice, sharing only happens when constructing via
403 /// `open_with_pristine`; `open` / `open_readonly` create a fresh
404 /// `Pristine` for each `Repository`.
405 pristine: Arc<Pristine>,
406 /// The filesystem change store for persisting canonical `.change` files.
407 change_store: ChangeStore,
408 /// Whether this handle was opened for an agent sandbox (via
409 /// [`Repository::open_sandbox`]). A sandbox's `dot_dir`/`pristine`/
410 /// `change_store` point at the canonical repository while `current_view`
411 /// holds the sandbox's view (from its pointer file); it must not repoint
412 /// the canonical `current_view` on disk.
413 is_sandbox: bool,
414 /// Per-process memo of the CRDT branch state folded per trunk over the
415 /// current assembly closure; see [`semantic_closure::SemanticClosureMemo`].
416 semantic_closure_memo: std::sync::Mutex<semantic_closure::SemanticClosureMemo>,
417}
418
419impl std::fmt::Debug for Repository {
420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

Callers 15

fromMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
evidence_cli_errorFunction · 0.85
view_listFunction · 0.85
runMethod · 0.85
adoptMethod · 0.85
forkMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls