Get the message for the revised change. Shared by the local body and the service-layer hook: the editor and the no-edit fallback are client-side by design, so the routed reword path composes the message with this SAME code (seeded with the change's current message fetched over the wire) and sends it.
(&self, original_message: &str)
| 368 | /// path composes the message with this SAME code (seeded with the |
| 369 | /// change's current message fetched over the wire) and sends it. |
| 370 | pub(crate) fn get_message(&self, original_message: &str) -> CliResult<String> { |
| 371 | // If explicit message provided, use it |
| 372 | if let Some(ref msg) = self.message { |
| 373 | return Ok(msg.clone()); |
| 374 | } |
| 375 | |
| 376 | // If reword mode and not no-edit, open editor |
| 377 | if self.reword && !self.no_edit { |
| 378 | return self.get_message_from_editor(original_message); |
| 379 | } |
| 380 | |
| 381 | // Otherwise use original message |
| 382 | Ok(original_message.to_string()) |
| 383 | } |
| 384 | |
| 385 | /// Open an editor for the user to edit the message. |
| 386 | fn get_message_from_editor(&self, original_message: &str) -> CliResult<String> { |