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

Method materialize_sequential

atomic-repository/src/repository/materialize.rs:108–135  ·  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

106 /// Used when the parallel path is not suitable (e.g., memory-constrained
107 /// environments).
108 pub fn materialize_sequential(&self) -> Result<MaterializeResult, RepositoryError> {
109 let txn = self
110 .pristine
111 .read_txn()
112 .map_err(|e| RepositoryError::Database(e.to_string()))?;
113
114 let view = txn
115 .get_view(&self.current_view)
116 .map_err(|e| RepositoryError::Database(e.to_string()))?
117 .ok_or_else(|| RepositoryError::ViewNotFound {
118 name: self.current_view.clone(),
119 })?;
120
121 let change_filter = collect_visible_change_ids(&txn, &view)?;
122
123 let cached_txn =
124 CachedGraphTxn::new(&txn).map_err(|e| RepositoryError::Database(e.to_string()))?;
125
126 let working_copy = FileSystem::from_root(&self.root);
127 let options = MaterializeOptions::new().with_change_filter(change_filter);
128
129 let result = materialize_view(&cached_txn, &self.change_store, &working_copy, options)
130 .map_err(|e| RepositoryError::Output(format!("{}", e)))?;
131
132 self.populate_file_index(&result);
133
134 Ok(result)
135 }
136
137 /// Materialize only specific files to the working copy.
138 ///

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