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

Function format_record_stats

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

Shared rendering for native and service-routed record outcomes.

(stats: &atomic_repository::record::RecordStats)

Source from the content-addressed store, hash-verified

141
142/// Shared rendering for native and service-routed record outcomes.
143pub(crate) fn format_record_stats(stats: &atomic_repository::record::RecordStats) -> String {
144 let mut output = String::new();
145 if stats.has_changes() {
146 output.push_str(&format!(
147 " {} changed, +{} vertices, ~{} edges, {} bytes\n",
148 format_count(stats.files_recorded, "file"),
149 stats.vertices_added,
150 stats.edges_modified,
151 stats.content_bytes
152 ));
153 let line_changes = stats.total_line_changes();
154 if line_changes > 0 {
155 output.push_str(&format!(
156 " {} (+{} -{} ~{})\n",
157 format_count(line_changes, "line"),
158 stats.lines_added,
159 stats.lines_deleted,
160 stats.lines_modified
161 ));
162 }
163 let token_ops = stats.total_token_ops();
164 if token_ops > 0 {
165 output.push_str(&format!(
166 " {} (+{} -{} ~{})\n",
167 format_count(token_ops, "token"),
168 stats.tokens_added,
169 stats.tokens_deleted,
170 stats.tokens_replaced
171 ));
172 }
173 }
174 output
175}
176
177/// The dry-run preview, pure over its inputs — the same lines the local
178/// body prints, shared with the routed path (the wire's Status entries

Calls 3

has_changesMethod · 0.45
total_line_changesMethod · 0.45
total_token_opsMethod · 0.45