[−][src]Function hg::dagops::retain_heads
pub fn retain_heads(
graph: &impl Graph,
revs: &mut HashSet<Revision>
) -> Result<(), GraphError>
Retain in revs
only its relative heads.
This is an in-place operation, so that control of the incoming set is left to the caller.
- a direct Python binding would probably need to build its own
HashSet
from an incoming iterable, even if its sole purpose is to extract the heads. - a Rust caller can decide whether cloning beforehand is appropriate
Performance notes
Internally, this function will store a full copy of revs
in a Vec
.