extract_patch_displays

Function extract_patch_displays 

Source
pub async fn extract_patch_displays(
    resource: &LockedResource,
    cache: &Cache,
) -> Vec<PatchDisplay>
Expand description

Extract patch display information for a locked resource.

This function:

  1. Reads the original file from the source worktree
  2. Parses it to extract original field values
  3. Combines with the overridden values from the applied patches
  4. Returns formatted patch display information

§Arguments

  • resource - The locked resource with patch information
  • cache - Repository cache to access source worktrees

§Returns

A vector of PatchDisplay entries with original and overridden values. If the source file cannot be read or parsed, displays show only overridden values with “(none)” for the original value.

§Examples

use agpm_cli::lockfile::patch_display::extract_patch_displays;
use agpm_cli::lockfile::LockedResource;
use agpm_cli::cache::Cache;

let cache = Cache::new()?;
let resource = LockedResource {
    // ... resource fields
};

let displays = extract_patch_displays(&resource, &cache).await;
for display in displays {
    println!("{}", display.format());
}