pub struct MissingAncestors<G: Graph> { /* private fields */ }
Implementations§
Source§impl<G: Graph> MissingAncestors<G>
impl<G: Graph> MissingAncestors<G>
pub fn new(graph: G, bases: impl IntoIterator<Item = Revision>) -> Self
pub fn has_bases(&self) -> bool
Sourcepub fn get_bases<'a>(&'a self) -> &'a HashSet<Revision>
pub fn get_bases<'a>(&'a self) -> &'a HashSet<Revision>
Return a reference to current bases.
This is useful in unit tests, but also setdiscovery.py does read the bases attribute of a ancestor.missingancestors instance.
Sourcepub fn bases_heads(&self) -> Result<HashSet<Revision>, GraphError>
pub fn bases_heads(&self) -> Result<HashSet<Revision>, GraphError>
Computes the relative heads of current bases.
The object is still usable after this.
Sourcepub fn into_bases_heads(self) -> Result<HashSet<Revision>, GraphError>
pub fn into_bases_heads(self) -> Result<HashSet<Revision>, GraphError>
Consumes the object and returns the relative heads of its bases.
Sourcepub fn add_bases(&mut self, new_bases: impl IntoIterator<Item = Revision>)
pub fn add_bases(&mut self, new_bases: impl IntoIterator<Item = Revision>)
Add some revisions to self.bases
Takes care of keeping self.max_base
up to date.
Sourcepub fn remove_ancestors_from(
&mut self,
revs: &mut HashSet<Revision>,
) -> Result<(), GraphError>
pub fn remove_ancestors_from( &mut self, revs: &mut HashSet<Revision>, ) -> Result<(), GraphError>
Remove all ancestors of self.bases from the revs set (in place)
Sourcepub fn missing_ancestors(
&mut self,
revs: impl IntoIterator<Item = Revision>,
) -> Result<Vec<Revision>, GraphError>
pub fn missing_ancestors( &mut self, revs: impl IntoIterator<Item = Revision>, ) -> Result<Vec<Revision>, GraphError>
Return all the ancestors of revs that are not ancestors of self.bases
This may include elements from revs.
Equivalent to the revset (::revs - ::self.bases). Revs are returned in revision number order, which is a topological order.
Auto Trait Implementations§
impl<G> Freeze for MissingAncestors<G>where
G: Freeze,
impl<G> RefUnwindSafe for MissingAncestors<G>where
G: RefUnwindSafe,
impl<G> Send for MissingAncestors<G>where
G: Send,
impl<G> Sync for MissingAncestors<G>where
G: Sync,
impl<G> Unpin for MissingAncestors<G>where
G: Unpin,
impl<G> UnwindSafe for MissingAncestors<G>where
G: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more