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

Class Repository

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

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

Callers 15

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

Calls

no outgoing calls

Tested by 1

runMethod · 0.68