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>,
)
| 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. |
| 386 | pub 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)] |
| 397 | mod tests { |
no outgoing calls