(
repo: &atomic_repository::Repository,
working_copy: atomic_core::types::WorkingCopyId,
)
| 500 | } |
| 501 | |
| 502 | fn sole_working_copy_operation( |
| 503 | repo: &atomic_repository::Repository, |
| 504 | working_copy: atomic_core::types::WorkingCopyId, |
| 505 | ) -> CliResult<OperationId> { |
| 506 | let log = repo |
| 507 | .operation_log( |
| 508 | atomic_core::operation::OperationScope::WorkingCopy(working_copy), |
| 509 | Some(1), |
| 510 | false, |
| 511 | ) |
| 512 | .map_err(CliError::from)?; |
| 513 | match log.head_state { |
| 514 | atomic_repository::OperationHeadState::Single(head) => Ok(head), |
| 515 | OperationHeadState::Empty => Err(CliError::Repository( |
| 516 | atomic_repository::RepositoryError::InvalidOperation { |
| 517 | message: "no causal operation exists to bind; record or project state first" |
| 518 | .to_string(), |
| 519 | }, |
| 520 | )), |
| 521 | OperationHeadState::Diverged(heads) => Err(CliError::Repository( |
| 522 | atomic_repository::RepositoryError::InvalidOperation { |
| 523 | message: format!( |
| 524 | "operation heads are diverged: {}", |
| 525 | heads |
| 526 | .iter() |
| 527 | .map(ToString::to_string) |
| 528 | .collect::<Vec<_>>() |
| 529 | .join(", ") |
| 530 | ), |
| 531 | }, |
| 532 | )), |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | fn verify(id: &str) -> CliResult<()> { |
| 537 | let root = find_repository_root()?; |
no test coverage detected