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],
)
| 319 | /// Local: main at ABC123... (10 changes) |
| 320 | /// ``` |
| 321 | pub fn display_state_comparison( |
| 322 | local_view: &str, |
| 323 | local_entries: &[HistoryEntry], |
| 324 | remote_view: &str, |
| 325 | remote_state: &StateResponse, |
| 326 | remote_entries: &[ChangelistEntry], |
| 327 | ) { |
| 328 | let local_state_str = format_local_state(local_entries); |
| 329 | let remote_state_str = format_remote_state(remote_state, remote_entries); |
| 330 | |
| 331 | println!( |
| 332 | " {}: {} {}", |
| 333 | info("Remote"), |
| 334 | style_view(remote_view), |
| 335 | remote_state_str |
| 336 | ); |
| 337 | println!( |
| 338 | " {}: {} {}", |
| 339 | info("Local"), |
| 340 | style_view(local_view), |
| 341 | local_state_str |
| 342 | ); |
| 343 | } |
| 344 | |
| 345 | /// Format the local state for display. |
| 346 | /// |
no test coverage detected