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

Method materialize_sequential

atomic-repository/src/repository/materialize.rs:248–275  ·  view source on GitHub ↗

Sequential materialize fallback. Processes files one at a time through the streaming writer path. Used when the parallel path is not suitable (e.g., memory-constrained environments).

(&self)

Source from the content-addressed store, hash-verified

246 /// Used when the parallel path is not suitable (e.g., memory-constrained
247 /// environments).
248 pub fn materialize_sequential(&self) -> Result<MaterializeResult, RepositoryError> {
249 let txn = self
250 .pristine
251 .read_txn()
252 .map_err(|e| RepositoryError::Database(e.to_string()))?;
253
254 let view = txn
255 .get_view(&self.current_view)
256 .map_err(|e| RepositoryError::Database(e.to_string()))?
257 .ok_or_else(|| RepositoryError::ViewNotFound {
258 name: self.current_view.clone(),
259 })?;
260
261 let change_filter = collect_visible_change_ids(&txn, &view)?;
262
263 let cached_txn =
264 CachedGraphTxn::new(&txn).map_err(|e| RepositoryError::Database(e.to_string()))?;
265
266 let working_copy = FileSystem::from_root(&self.root);
267 let options = MaterializeOptions::new().with_change_filter(change_filter);
268
269 let result = materialize_view(&cached_txn, &self.change_store, &working_copy, options)
270 .map_err(|e| RepositoryError::Output(format!("{}", e)))?;
271
272 self.populate_file_index(&result);
273
274 Ok(result)
275 }
276
277 /// Materialize only specific files to the working copy.
278 ///

Callers

nothing calls this directly

Calls 7

materialize_viewFunction · 0.85
read_txnMethod · 0.80
populate_file_indexMethod · 0.80
get_viewMethod · 0.45
cloneMethod · 0.45
with_change_filterMethod · 0.45

Tested by

no test coverage detected