(output: &mut String, indent: usize, state: &RepoStateDto)
| 356 | } |
| 357 | |
| 358 | fn write_repo_state(output: &mut String, indent: usize, state: &RepoStateDto) { |
| 359 | match &state.view { |
| 360 | Some(view) => { |
| 361 | writeln!(output, "{}view:", spaces(indent)).unwrap(); |
| 362 | write_key_value(output, indent + 2, "name", &view.name); |
| 363 | write_key_value(output, indent + 2, "state", &view.state); |
| 364 | write_key_value( |
| 365 | output, |
| 366 | indent + 2, |
| 367 | "set_id", |
| 368 | view.set_id.as_deref().unwrap_or("none"), |
| 369 | ); |
| 370 | } |
| 371 | None => write_key_value(output, indent, "view", "none"), |
| 372 | } |
| 373 | match &state.working_copy { |
| 374 | Some(working_copy) => { |
| 375 | writeln!(output, "{}working_copy:", spaces(indent)).unwrap(); |
| 376 | write_working_copy_state(output, indent + 2, working_copy); |
| 377 | } |
| 378 | None => write_key_value(output, indent, "working_copy", "none"), |
| 379 | } |
| 380 | match &state.git { |
| 381 | Some(git) => { |
| 382 | writeln!(output, "{}git:", spaces(indent)).unwrap(); |
| 383 | write_git_state(output, indent + 2, git); |
| 384 | } |
| 385 | None => write_key_value(output, indent, "git", "none"), |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | fn write_working_copy_state(output: &mut String, indent: usize, state: &WorkingCopyStateDto) { |
| 390 | write_key_value(output, indent, "id", &state.id); |
no test coverage detected