Print the human-readable flywheel chain: change -> activity -> generated -> agent -> person -> turnParent -> ... (walking `previous`).
(
repo: &Repository,
graphs: &[(Hash, ProvenanceGraph)],
change_hash: &Hash,
person_did: &str,
)
| 264 | /// Print the human-readable flywheel chain: change -> activity -> generated -> |
| 265 | /// agent -> person -> turnParent -> ... (walking `previous`). |
| 266 | fn print_trace( |
| 267 | repo: &Repository, |
| 268 | graphs: &[(Hash, ProvenanceGraph)], |
| 269 | change_hash: &Hash, |
| 270 | person_did: &str, |
| 271 | ) { |
| 272 | println!( |
| 273 | "{} {}", |
| 274 | emphasis("Provenance for change"), |
| 275 | info(&change_hash.to_base32()) |
| 276 | ); |
| 277 | for (i, (_, graph)) in graphs.iter().enumerate() { |
| 278 | if graphs.len() > 1 { |
| 279 | println!( |
| 280 | "{}", |
| 281 | hint(&format!(" [graph {} of {}]", i + 1, graphs.len())) |
| 282 | ); |
| 283 | } |
| 284 | let input = map_graph_to_input(repo, graph, change_hash, person_did); |
| 285 | print_activity_chain(repo, &input, graph); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | /// Print one activity and walk its `turnParent` chain via `previous`. |
| 290 | fn print_activity_chain(repo: &Repository, input: &ProvActivityInput, graph: &ProvenanceGraph) { |
no test coverage detected