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

Class Repository

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

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

Calls

no outgoing calls

Tested by 1

runMethod · 0.68