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

Method from_root

atomic-repository/src/changestore/mod.rs:261–264  ·  view source on GitHub ↗

Create a change store from a repository root directory. This is a convenience method that constructs the changes directory path from the repository root (containing `.atomic/`). # Arguments `root` - Path to the repository root `cache_capacity` - Maximum number of changes to keep in memory # Example ```rust,ignore let store = ChangeStore::from_root("/path/to/repo", 100)?; // Equivalent to: Cha

(root: P, cache_capacity: usize)

Source from the content-addressed store, hash-verified

259 /// // Equivalent to: ChangeStore::new("/path/to/repo/.atomic/changes", 100)
260 /// ```
261 pub fn from_root<P: AsRef<Path>>(root: P, cache_capacity: usize) -> ChangeStoreResult<Self> {
262 let changes_dir = root.as_ref().join(atomic_core::DOT_DIR).join("changes");
263 Self::new(changes_dir, cache_capacity)
264 }
265
266 /// Get the path to the changes directory.
267 pub fn changes_dir(&self) -> &Path {

Callers

nothing calls this directly

Calls 1

as_refMethod · 0.80

Tested by

no test coverage detected