Switch to a different view and update the working copy. This is the primary method for switching views. It: 1. Validates the view exists 2. Updates the current view pointer 3. Materializes the working copy to match the new view's state # Arguments `working_copy` - The validated physical working-copy identity `view` - The name of the view to switch to # Returns Statistics about the materialize
(
&mut self,
working_copy: WorkingCopyId,
view: &str,
)
| 478 | /// println!("Updated {} files", result.files_written); |
| 479 | /// ``` |
| 480 | pub fn switch_view( |
| 481 | &mut self, |
| 482 | working_copy: WorkingCopyId, |
| 483 | view: &str, |
| 484 | ) -> Result<MaterializeResult, RepositoryError> { |
| 485 | self.switch_view_with_operation( |
| 486 | working_copy, |
| 487 | view, |
| 488 | OperationKind::SwitchView, |
| 489 | None, |
| 490 | ActorRef::System { |
| 491 | name: "repository-switch".to_string(), |
| 492 | }, |
| 493 | None, |
| 494 | ) |
| 495 | } |
| 496 | |
| 497 | pub(super) fn switch_view_with_operation( |
| 498 | &mut self, |