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

Function resolve_overlay_creation

atomic-cli/src/commands/view/new.rs:386–394  ·  view source on GitHub ↗

Resolve how a new view is anchored and seeded. Returns `(anchor, seed)`: the overlay-chain anchor view (`None` means the repository default — the nearest Shared ancestor of the current view) and the view whose change-set membership seeds the new view's filter. # Model A view is a filter over the global graph: every node it exposes already lives in the graph. Creation selects where the overlay c

(
    from: Option<&str>,
    parent: Option<&str>,
)

Source from the content-addressed store, hash-verified

384/// optionally, which EXISTING changes the new view's filter starts with —
385/// nothing is copied out of the graph; no node is ever owned by two views.
386pub fn resolve_overlay_creation(
387 from: Option<&str>,
388 parent: Option<&str>,
389) -> (Option<String>, Option<String>) {
390 // --from anchors on its source unless an explicit --parent overrides;
391 // the seed is always the --from source.
392 let anchor = parent.or(from).map(|s| s.to_string());
393 (anchor, from.map(|s| s.to_string()))
394}
395
396#[cfg(test)]
397mod tests {

Callers 2

runMethod · 0.85

Calls

no outgoing calls

Tested by 1