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

Function display_state_comparison

atomic-cli/src/commands/push/helpers.rs:475–495  ·  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_view` - Name of the local view `local_entries` - Local history entries `remote_view` - Name of the remote view `remote_state` - Current state of the remote `remote_entries` - Remote changelist entries

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

Source from the content-addressed store, hash-verified

473/// * `remote_state` - Current state of the remote
474/// * `remote_entries` - Remote changelist entries
475pub fn display_state_comparison(
476 local_view: &str,
477 local_entries: &[HistoryEntry],
478 remote_view: &str,
479 remote_state: &StateResponse,
480 remote_entries: &[ChangelistEntry],
481) {
482 let local_state_str = format_local_state(local_entries);
483 let remote_state_str = format_remote_state(remote_state, remote_entries);
484
485 println!(
486 " Local: {} at {}",
487 style_view(local_view),
488 info(&local_state_str)
489 );
490 println!(
491 " Remote: {} at {}",
492 style_view(remote_view),
493 info(&remote_state_str)
494 );
495}
496
497/// Format the local state for display.
498fn format_local_state(entries: &[HistoryEntry]) -> String {

Callers 1

run_asyncMethod · 0.70

Calls 2

format_local_stateFunction · 0.70
format_remote_stateFunction · 0.70

Tested by

no test coverage detected