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

Function display_state_comparison

atomic-cli/tests/fixtures/helpers_c6.rs:440–460  ·  view source on GitHub ↗

Display the state comparison between local and remote. Shows the user a summary of where local and remote are at, helping them understand what will be pushed. # Arguments `local_stack` - Name of the local stack `local_entries` - Local history entries `remote_stack` - Name of the remote stack `remote_state` - Current state of the remote `remote_entries` - Remote changelist entries

(
    local_stack: &str,
    local_entries: &[HistoryEntry],
    remote_stack: &str,
    remote_state: &StateResponse,
    remote_entries: &[ChangelistEntry],
)

Source from the content-addressed store, hash-verified

438/// * `remote_state` - Current state of the remote
439/// * `remote_entries` - Remote changelist entries
440pub fn display_state_comparison(
441 local_stack: &str,
442 local_entries: &[HistoryEntry],
443 remote_stack: &str,
444 remote_state: &StateResponse,
445 remote_entries: &[ChangelistEntry],
446) {
447 let local_state_str = format_local_state(local_entries);
448 let remote_state_str = format_remote_state(remote_state, remote_entries);
449
450 println!(
451 " Local: {} at {}",
452 style_stack(local_stack),
453 info(&local_state_str)
454 );
455 println!(
456 " Remote: {} at {}",
457 style_stack(remote_stack),
458 info(&remote_state_str)
459 );
460}
461
462/// Format the local state for display.
463fn format_local_state(entries: &[HistoryEntry]) -> String {

Callers

nothing calls this directly

Calls 2

format_local_stateFunction · 0.70
format_remote_stateFunction · 0.70

Tested by

no test coverage detected