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

Method display_dry_run

atomic-cli/src/commands/record/format.rs:103–139  ·  view source on GitHub ↗

Display dry run preview.

(
        &self,
        repo: &Repository,
        working_copy: atomic_core::types::WorkingCopyId,
    )

Source from the content-addressed store, hash-verified

101
102 /// Display dry run preview.
103 pub(super) fn display_dry_run(
104 &self,
105 repo: &Repository,
106 working_copy: atomic_core::types::WorkingCopyId,
107 ) -> CliResult<()> {
108 let status = repo
109 .status(working_copy, StatusOptions::default())
110 .map_err(CliError::Repository)?;
111
112 let entries = status
113 .entries()
114 .iter()
115 .map(|entry| (entry.status(), entry.path().to_string_lossy().into_owned()))
116 .collect::<Vec<_>>();
117 render_dry_run(&entries, self.all, &self.files);
118 // Scoped stale-conflict cleanup is a metadata mutation that records no
119 // content change; surface exactly what an apply would clear.
120 if self.allow_conflict_markers && !self.all && !self.files.is_empty() {
121 if let Ok(report) = repo.inspect_stale_conflicts(working_copy, &self.files) {
122 let stale = report.stale_paths();
123 if !stale.is_empty() {
124 println!();
125 println!("Would clear stale conflict metadata (no content change):");
126 for path in &stale {
127 println!(" stale conflict: {}", path);
128 }
129 println!(
130 " {} row(s) across {} path(s)",
131 report.stale_row_count(),
132 stale.len()
133 );
134 }
135 }
136 }
137
138 Ok(())
139 }
140}
141
142/// Shared rendering for native and service-routed record outcomes.

Callers 1

runMethod · 0.45

Calls 8

render_dry_runFunction · 0.85
entriesMethod · 0.80
stale_pathsMethod · 0.80
statusMethod · 0.45
iterMethod · 0.45
pathMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected