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

Function print_trace_local

atomic-cli/src/commands/provenance/command.rs:372–393  ·  view source on GitHub ↗

The local fallback render (outside a routed repository): the same chain with the graphs walked live from the repository handle.

(
    repo: &Repository,
    graphs: &[(Hash, ProvenanceGraph)],
    change_hash: &Hash,
    person_did: &str,
)

Source from the content-addressed store, hash-verified

370/// The local fallback render (outside a routed repository): the same
371/// chain with the graphs walked live from the repository handle.
372fn print_trace_local(
373 repo: &Repository,
374 graphs: &[(Hash, ProvenanceGraph)],
375 change_hash: &Hash,
376 person_did: &str,
377) {
378 println!(
379 "{} {}",
380 emphasis("Provenance for change"),
381 info(&change_hash.to_base32())
382 );
383 for (i, (_, graph)) in graphs.iter().enumerate() {
384 if graphs.len() > 1 {
385 println!(
386 "{}",
387 hint(&format!(" [graph {} of {}]", i + 1, graphs.len()))
388 );
389 }
390 let input = map_graph_to_input(repo, graph, change_hash, person_did);
391 print_activity_chain_local(repo, &input, graph);
392 }
393}
394
395/// Print one activity and its prior-turn chain — the routed render: the
396/// activity block projects from the wire-carried input, and the chain

Callers 1

runMethod · 0.85

Calls 4

map_graph_to_inputFunction · 0.85
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected