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

Class Repository

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

177/// [`ChangeStore`]. For concurrent access, use separate `Repository`
178/// instances or wrap in appropriate synchronization primitives.
179pub struct Repository {
180 /// Root path of the repository (contains .atomic/)
181 root: PathBuf,
182 /// Path to the .atomic directory
183 dot_dir: PathBuf,
184 /// Current view name
185 current_view: String,
186 /// The pristine database handle.
187 ///
188 /// Wrapped in `Arc` so that multiple `Repository` instances _can_
189 /// share the same underlying redb `Database` and avoid stale-snapshot
190 /// bugs. In practice, sharing only happens when constructing via
191 /// `open_with_pristine`; `open` / `open_readonly` create a fresh
192 /// `Pristine` for each `Repository`.
193 pristine: Arc<Pristine>,
194 /// The change store for persisting changes
195 change_store: ChangeStore,
196 /// Whether this handle was opened for an agent sandbox (via
197 /// [`Repository::open_sandbox`]). A sandbox's `dot_dir`/`pristine`/
198 /// `change_store` point at the canonical repository while `current_view`
199 /// holds the sandbox's view (from its pointer file); it must not repoint
200 /// the canonical `current_view` on disk.
201 is_sandbox: bool,
202}
203
204impl std::fmt::Debug for Repository {
205 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

Callers 15

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
executeMethod · 0.85
resolve_remote_urlMethod · 0.85
run_asyncMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by 1

runMethod · 0.68