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