Skip to main content

peel_once

Function peel_once 

Source
pub fn peel_once<G>(graph: &G, node: NodeId) -> Result<Option<NodeId>>
Expand description

Peel a node once, following the natural SWH object model.

The peeling rules are:

  • Origin → first snapshot successor

  • Snapshot → HEAD revision (as per vcs::find_head_rev) if it exists, first revision or release successor if not

  • Release → follows release target (first successor of any kind)

  • Revision → follows root directory successor

  • Directory and Content cannot be peeled further (error)

Returns Ok(Some(node_id)) on success, Ok(None) if no suitable successor exists.