Display the dry run preview.
(
&self,
remote_url: &str,
remote_view: &str,
to_upload: &[PushChange],
)
| 272 | |
| 273 | /// Display the dry run preview. |
| 274 | fn display_dry_run( |
| 275 | &self, |
| 276 | remote_url: &str, |
| 277 | remote_view: &str, |
| 278 | to_upload: &[PushChange], |
| 279 | ) -> CliResult<()> { |
| 280 | if to_upload.is_empty() { |
| 281 | print_success("Already up to date - nothing to push"); |
| 282 | return Ok(()); |
| 283 | } |
| 284 | |
| 285 | println!( |
| 286 | "Would push {} to {} (view: {}):", |
| 287 | format_count(to_upload.len(), "change"), |
| 288 | self.remote, |
| 289 | remote_view |
| 290 | ); |
| 291 | print_blank(); |
| 292 | |
| 293 | for change in to_upload { |
| 294 | let hash_str = format_hash(&change.hash, false); |
| 295 | let msg = change.message_or_default(); |
| 296 | println!(" {} {}", style_hash(&hash_str), msg); |
| 297 | } |
| 298 | |
| 299 | print_blank(); |
| 300 | print_hint(&format!("Remote URL: {}", remote_url)); |
| 301 | |
| 302 | Ok(()) |
| 303 | } |
| 304 | |
| 305 | /// Async implementation of the push command. |
| 306 | async fn run_async(&self) -> CliResult<()> { |
no test coverage detected