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

Function display_state_comparison

atomic-cli/tests/fixtures/helpers_c5.rs:498–518  ·  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

496/// * `remote_state` - Current state of the remote
497/// * `remote_entries` - Remote changelist entries
498pub fn display_state_comparison(
499 local_stack: &str,
500 local_entries: &[HistoryEntry],
501 remote_stack: &str,
502 remote_state: &StateResponse,
503 remote_entries: &[ChangelistEntry],
504) {
505 let local_state_str = format_local_state(local_entries);
506 let remote_state_str = format_remote_state(remote_state, remote_entries);
507
508 println!(
509 " Local: {} at {}",
510 style_stack(local_stack),
511 info(&local_state_str)
512 );
513 println!(
514 " Remote: {} at {}",
515 style_stack(remote_stack),
516 info(&remote_state_str)
517 );
518}
519
520/// Format the local state for display.
521fn 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