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

Method display_dry_run

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

311
312 /// Display the dry run preview: per-view manifest sync plans.
313 fn display_dry_run(
314 &self,
315 repo: &Repository,
316 remote_name: &str,
317 remote_url: &str,
318 syncs: &[ViewSync],
319 ) -> CliResult<()> {
320 let active: Vec<&ViewSync> = syncs.iter().filter(|s| !s.plan.is_noop()).collect();
321
322 if active.is_empty() {
323 print_success("Already up to date - nothing to push");
324 return Ok(());
325 }
326
327 println!(
328 "Would sync {} to {}:",
329 format_count(active.len(), "view"),
330 remote_name
331 );
332 print_blank();
333
334 for sync in &active {
335 let scope = sync.manifest.scope.to_string();
336 let parent = sync
337 .manifest
338 .parent
339 .as_deref()
340 .map(|p| format!(", parent {}", p))
341 .unwrap_or_default();
342 println!(
343 " {} [{}{}]: {} to store, declare manifest ({} in log)",
344 style_view(&sync.remote_name),
345 scope,
346 parent,
347 format_count(sync.to_store.len(), "change"),
348 format_count(sync.manifest.changes.len(), "change"),
349 );
350 for hash in &sync.to_store {
351 let msg =
352 load_change_message(repo, hash).unwrap_or_else(|| "(no message)".to_string());
353 println!(" {} {}", style_hash(&format_hash(hash, false)), msg);
354 }
355 }
356
357 print_blank();
358 print_hint(&format!("Remote URL: {}", remote_url));
359
360 Ok(())
361 }
362
363 /// Report a divergence conflict and build the error to return.
364 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