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

Class Repository

atomic-repository/src/repository/mod.rs:378–404  ·  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

376/// [`ChangeStore`]. For concurrent access, use separate `Repository`
377/// instances or wrap in appropriate synchronization primitives.
378pub 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
406impl std::fmt::Debug for Repository {
407 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

Callers 15

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
runMethod · 0.85

Calls

no outgoing calls