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

Method display_dry_run

atomic-cli/src/commands/push/command.rs:393–441  ·  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

391
392 /// Display the dry run preview: per-view manifest sync plans.
393 fn display_dry_run(
394 &self,
395 repo: &Repository,
396 remote_name: &str,
397 remote_url: &str,
398 syncs: &[ViewSync],
399 ) -> CliResult<()> {
400 let active: Vec<&ViewSync> = syncs.iter().filter(|s| !s.plan.is_noop()).collect();
401
402 if active.is_empty() {
403 print_success("Already up to date - nothing to push");
404 return Ok(());
405 }
406
407 println!(
408 "Would sync {} to {}:",
409 format_count(active.len(), "view"),
410 remote_name
411 );
412 print_blank();
413
414 for sync in &active {
415 let scope = sync.manifest.scope.to_string();
416 let parent = sync
417 .manifest
418 .parent
419 .as_deref()
420 .map(|p| format!(", parent {}", p))
421 .unwrap_or_default();
422 println!(
423 " {} [{}{}]: {} to store, declare manifest ({} in log)",
424 style_view(&sync.remote_name),
425 scope,
426 parent,
427 format_count(sync.to_store.len(), "change"),
428 format_count(sync.manifest.changes.len(), "change"),
429 );
430 for hash in &sync.to_store {
431 let msg =
432 load_change_message(repo, hash).unwrap_or_else(|| "(no message)".to_string());
433 println!(" {} {}", style_hash(&format_hash(hash, false)), msg);
434 }
435 }
436
437 print_blank();
438 print_hint(&format!("Remote URL: {}", remote_url));
439
440 Ok(())
441 }
442
443 /// Report a divergence conflict and build the error to return.
444 fn divergence_error(

Callers 1

run_asyncMethod · 0.45

Calls 7

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

Tested by

no test coverage detected