(&self)
| 19 | |
| 20 | impl Command for Show { |
| 21 | fn run(&self) -> CliResult<()> { |
| 22 | let root = find_repository_root()?; |
| 23 | let repo = Repository::open(&root).map_err(|error| match error { |
| 24 | atomic_repository::RepositoryError::NotFound { path } => CliError::RepositoryNotFound { |
| 25 | searched_path: path.into(), |
| 26 | }, |
| 27 | other => CliError::Repository(other), |
| 28 | })?; |
| 29 | let name = match &self.name { |
| 30 | Some(name) => name.clone(), |
| 31 | None => { |
| 32 | let working_copy = repo |
| 33 | .require_working_copy_id() |
| 34 | .map_err(CliError::Repository)?; |
| 35 | repo.desired_view_name(working_copy) |
| 36 | .map_err(CliError::Repository)? |
| 37 | } |
| 38 | }; |
| 39 | let info = repo.get_view_info(&name).map_err(CliError::Repository)?; |
| 40 | let identity = repo |
| 41 | .refresh_view_set_id_index(&name) |
| 42 | .map_err(CliError::Repository)?; |
| 43 | |
| 44 | println!("View: {}", style_view(&info.name)); |
| 45 | println!("Scope: {}", info.kind_label()); |
| 46 | println!("Parent: {}", hint(info.parent_display())); |
| 47 | println!("Changes: {}", identity.closure_len); |
| 48 | println!("Merkle: {}", identity.merkle.to_base32()); |
| 49 | println!("SetId: {}", identity.set_id.to_base32()); |
| 50 | Ok(()) |
| 51 | } |
| 52 | } |
nothing calls this directly
no test coverage detected