Materialize the working copy for a specific prefix only. This is useful for partial updates when you only want to sync a subset of files. # Arguments `prefix` - Path prefix to materialize (e.g., "src/") # Returns Statistics about the materialize operation.
(&self, prefix: &str)
| 916 | /// |
| 917 | /// Statistics about the materialize operation. |
| 918 | pub fn materialize_prefix(&self, prefix: &str) -> Result<MaterializeResult, RepositoryError> { |
| 919 | let txn = self |
| 920 | .pristine |
| 921 | .read_txn() |
| 922 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 923 | |
| 924 | // Get the current view for the change filter |
| 925 | let view = txn |
| 926 | .get_view(&self.current_view) |
| 927 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 928 | .ok_or_else(|| RepositoryError::ViewNotFound { |
| 929 | name: self.current_view.clone(), |
| 930 | })?; |
| 931 | |
| 932 | let change_filter = collect_visible_change_ids(&txn, &view)?; |
| 933 | |
| 934 | let cached_txn = |
| 935 | CachedGraphTxn::new(&txn).map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 936 | |
| 937 | let working_copy = FileSystem::from_root(&self.root); |
| 938 | let options = MaterializeOptions::new() |
| 939 | .prefix(prefix) |
| 940 | .with_change_filter(change_filter); |
| 941 | |
| 942 | let result = materialize_view(&cached_txn, &self.change_store, &working_copy, options) |
| 943 | .map_err(|e| RepositoryError::Output(format!("{}", e)))?; |
| 944 | |
| 945 | self.populate_file_index(&result); |
| 946 | |
| 947 | Ok(result) |
| 948 | } |
| 949 | } |
nothing calls this directly
no test coverage detected