`atomic sandbox create` over CreateSandboxTree — every form. The handler resolves the destination (the same default), creates the draft when --from names one, provisions the copy-on-write tree, and the CLI prints the local report from the wire-carried outcome.
(args: &super::sandbox::Create)
| 5972 | /// when --from names one, provisions the copy-on-write tree, and the CLI |
| 5973 | /// prints the local report from the wire-carried outcome. |
| 5974 | pub fn sandbox_create(args: &super::sandbox::Create) -> CliResult<bool> { |
| 5975 | let Some(session) = Service::open()? else { |
| 5976 | return Ok(false); |
| 5977 | }; |
| 5978 | let request = pb::CreateSandboxTreeRequest { |
| 5979 | repository: Some(session.reference.clone()), |
| 5980 | meta: request_meta(), |
| 5981 | name: args.name.clone(), |
| 5982 | from_view: args.from.clone(), |
| 5983 | dest: args.dest.as_ref().map(|dest| dest.display().to_string()), |
| 5984 | view: args.view.clone(), |
| 5985 | }; |
| 5986 | let response = session.create_sandbox_tree(request)?; |
| 5987 | println!("Sandbox '{}' created", args.name); |
| 5988 | println!(" Working tree: {}", response.resolved_dest); |
| 5989 | if response.created_draft { |
| 5990 | println!( |
| 5991 | " View: {} (new draft from '{}')", |
| 5992 | response.view, |
| 5993 | args.from.as_deref().unwrap_or("") |
| 5994 | ); |
| 5995 | } else { |
| 5996 | println!(" View: {}", response.view); |
| 5997 | } |
| 5998 | println!( |
| 5999 | " Files cloned: {} (copy-on-write where supported)", |
| 6000 | response.files_cloned |
| 6001 | ); |
| 6002 | println!( |
| 6003 | " Graph: shared (canonical {}/.atomic)", |
| 6004 | response.repo_root |
| 6005 | ); |
| 6006 | Ok(true) |
| 6007 | } |
| 6008 | |
| 6009 | /// `atomic sandbox stage` over StageSandboxImage — the base view, output |
| 6010 | /// dir, and the staged report all ride the wire. |
no test coverage detected