Compose the interactive message before entering the shared domain flow.
(&self, repo: &mut Repository, entry: &HistoryEntry)
| 527 | |
| 528 | /// Compose the interactive message before entering the shared domain flow. |
| 529 | fn execute_revise(&self, repo: &mut Repository, entry: &HistoryEntry) -> CliResult<Hash> { |
| 530 | let original = repo |
| 531 | .load_change(&entry.hash) |
| 532 | .map_err(CliError::Repository)?; |
| 533 | let message = self.get_message(&original.hashed.header.message)?; |
| 534 | let author = self |
| 535 | .parse_author() |
| 536 | .map(|(name, email)| atomic_core::change::Author { |
| 537 | name, |
| 538 | email, |
| 539 | identity: None, |
| 540 | }); |
| 541 | let paths = self |
| 542 | .files |
| 543 | .iter() |
| 544 | .map(|path| path.to_string_lossy().into_owned()) |
| 545 | .collect(); |
| 546 | repo.revise_content(&entry.hash, &message, author, paths) |
| 547 | .map(|outcome| outcome.new_hash) |
| 548 | .map_err(CliError::Repository) |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | impl Default for Revise { |
no test coverage detected