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

Function display_state_comparison

atomic-cli/src/commands/pull/helpers.rs:303–325  ·  view source on GitHub ↗

Display a comparison of local and remote state. Shows the user where both repositories are in their history, making it easier to understand what will be pulled. # Arguments `local_view` - The name of the local view `local_entries` - Local history entries `remote_view` - The name of the remote view `remote_state` - The remote's current state response `remote_entries` - The remote's changelist en

(
    local_view: &str,
    local_entries: &[HistoryEntry],
    remote_view: &str,
    remote_state: &StateResponse,
    remote_entries: &[ChangelistEntry],
)

Source from the content-addressed store, hash-verified

301/// Local: main at ABC123... (10 changes)
302/// ```
303pub fn display_state_comparison(
304 local_view: &str,
305 local_entries: &[HistoryEntry],
306 remote_view: &str,
307 remote_state: &StateResponse,
308 remote_entries: &[ChangelistEntry],
309) {
310 let local_state_str = format_local_state(local_entries);
311 let remote_state_str = format_remote_state(remote_state, remote_entries);
312
313 println!(
314 " {}: {} {}",
315 info("Remote"),
316 style_view(remote_view),
317 remote_state_str
318 );
319 println!(
320 " {}: {} {}",
321 info("Local"),
322 style_view(local_view),
323 local_state_str
324 );
325}
326
327/// Format the local state for display.
328///

Callers 1

run_asyncMethod · 0.70

Calls 2

format_local_stateFunction · 0.70
format_remote_stateFunction · 0.70

Tested by

no test coverage detected