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

Class Repository

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

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