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