Skip to main content

relativize_level

Function relativize_level 

Source
pub fn relativize_level(
    level: &mut LevelGraph,
    target: &Path,
    roots: &BTreeMap<String, String>,
)
Expand description

Rewrite a file-based level graph from absolute paths to relativized ids:

  • file node ids (absolute paths) → {target}/rel or {root}/rel;
  • edge endpoints, node parents and cycle node lists follow the same map;
  • external node path attributes are relativized too;
  • redundant/empty path attributes are dropped (a file node’s id IS its path, so it carries none).