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

Class Repository

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

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