MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / display_dry_run

Method display_dry_run

atomic-cli/src/commands/push/command.rs:415–463  ·  view source on GitHub ↗

Display the dry run preview: per-view manifest sync plans.

(
        &self,
        repo: &Repository,
        remote_name: &str,
        remote_url: &str,
        syncs: &[ViewSync],
    )

Source from the content-addressed store, hash-verified

413
414 /// Display the dry run preview: per-view manifest sync plans.
415 fn display_dry_run(
416 &self,
417 repo: &Repository,
418 remote_name: &str,
419 remote_url: &str,
420 syncs: &[ViewSync],
421 ) -> CliResult<()> {
422 let active: Vec<&ViewSync> = syncs.iter().filter(|s| !s.plan.is_noop()).collect();
423
424 if active.is_empty() {
425 print_success("Already up to date - nothing to push");
426 return Ok(());
427 }
428
429 println!(
430 "Would sync {} to {}:",
431 format_count(active.len(), "view"),
432 remote_name
433 );
434 print_blank();
435
436 for sync in &active {
437 let scope = sync.manifest.scope.to_string();
438 let parent = sync
439 .manifest
440 .parent
441 .as_deref()
442 .map(|p| format!(", parent {}", p))
443 .unwrap_or_default();
444 println!(
445 " {} [{}{}]: {} to store, declare manifest ({} in log)",
446 style_view(&sync.remote_name),
447 scope,
448 parent,
449 format_count(sync.to_store.len(), "change"),
450 format_count(sync.manifest.changes.len(), "change"),
451 );
452 for hash in &sync.to_store {
453 let msg =
454 load_change_message(repo, hash).unwrap_or_else(|| "(no message)".to_string());
455 println!(" {} {}", style_hash(&format_hash(hash, false)), msg);
456 }
457 }
458
459 print_blank();
460 print_hint(&format!("Remote URL: {}", remote_url));
461
462 Ok(())
463 }
464
465 /// Report a divergence conflict and build the error to return.
466 fn divergence_error(

Callers 1

run_asyncMethod · 0.45

Calls 8

print_successFunction · 0.85
print_blankFunction · 0.85
print_hintFunction · 0.85
load_change_messageFunction · 0.70
collectMethod · 0.45
iterMethod · 0.45
is_noopMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected