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

Method switch_view

atomic-repository/src/repository/switch.rs:480–495  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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,

Calls 1