Struct MissingAncestors

Source
pub struct MissingAncestors<G: Graph> { /* private fields */ }

Implementations§

Source§

impl<G: Graph> MissingAncestors<G>

Source

pub fn new(graph: G, bases: impl IntoIterator<Item = Revision>) -> Self

Source

pub fn has_bases(&self) -> bool

Source

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.

Source

pub fn bases_heads(&self) -> Result<HashSet<Revision>, GraphError>

Computes the relative heads of current bases.

The object is still usable after this.

Source

pub fn into_bases_heads(self) -> Result<HashSet<Revision>, GraphError>

Consumes the object and returns the relative heads of its bases.

Source

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.

Source

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)

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.