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)
| 670 | /// |
| 671 | /// Statistics about the materialize operation. |
| 672 | pub fn materialize_prefix(&self, prefix: &str) -> Result<MaterializeResult, RepositoryError> { |
| 673 | let txn = self |
| 674 | .pristine |
| 675 | .read_txn() |
| 676 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 677 | |
| 678 | // Get the current view for the change filter |
| 679 | let view = txn |
| 680 | .get_view(&self.current_view) |
| 681 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 682 | .ok_or_else(|| RepositoryError::ViewNotFound { |
| 683 | name: self.current_view.clone(), |
| 684 | })?; |
| 685 | |
| 686 | let change_filter = collect_visible_change_ids(&txn, &view)?; |
| 687 | |
| 688 | let cached_txn = |
| 689 | CachedGraphTxn::new(&txn).map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 690 | |
| 691 | let working_copy = FileSystem::from_root(&self.root); |
| 692 | let options = MaterializeOptions::new() |
| 693 | .prefix(prefix) |
| 694 | .with_change_filter(change_filter); |
| 695 | |
| 696 | let result = materialize_view(&cached_txn, &self.change_store, &working_copy, options) |
| 697 | .map_err(|e| RepositoryError::Output(format!("{}", e)))?; |
| 698 | |
| 699 | self.populate_file_index(&result); |
| 700 | |
| 701 | Ok(result) |
| 702 | } |
| 703 | } |
nothing calls this directly
no test coverage detected