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

Method load_json_ledger

atomic-cli/src/commands/change/command.rs:673–679  ·  view source on GitHub ↗

Load the change ledger(s) — the causal decision graph(s) from the `.provenance` file — for JSON output. Mirrors the `=== Change Ledger ===` section of the default text format. Missing/corrupt provenance is non-fatal: the ledger simply stays empty (and is omitted from the JSON).

(&self, hash: &Hash, repo: &Repository)

Source from the content-addressed store, hash-verified

671 /// section of the default text format. Missing/corrupt provenance is
672 /// non-fatal: the ledger simply stays empty (and is omitted from the JSON).
673 fn load_json_ledger(&self, hash: &Hash, repo: &Repository) -> Vec<JsonChangeLedger> {
674 repo.find_provenance_for_change(hash)
675 .unwrap_or_default()
676 .iter()
677 .map(|(graph_hash, graph)| JsonChangeLedger::from_graph(graph_hash, graph))
678 .collect()
679 }
680
681 /// Print the change in the configured format.
682 fn print_change(&self, change: &Change, hash: &Hash, sequence: Option<u64>, repo: &Repository) {

Callers 1

print_changeMethod · 0.80

Calls 2

iterMethod · 0.45

Tested by

no test coverage detected