Enum RevsetExpression

Source
pub enum RevsetExpression<St: ExpressionState> {
Show 28 variants None, All, VisibleHeads, VisibleHeadsOrReferenced, Root, Commits(Vec<CommitId>), CommitRef(St::CommitRef), Ancestors { heads: Rc<Self>, generation: Range<u64>, }, Descendants { roots: Rc<Self>, generation: Range<u64>, }, Range { roots: Rc<Self>, heads: Rc<Self>, generation: Range<u64>, }, DagRange { roots: Rc<Self>, heads: Rc<Self>, }, Reachable { sources: Rc<Self>, domain: Rc<Self>, }, Heads(Rc<Self>), HeadsRange { roots: Rc<Self>, heads: Rc<Self>, filter: Rc<Self>, }, Roots(Rc<Self>), ForkPoint(Rc<Self>), Latest { candidates: Rc<Self>, count: usize, }, Filter(RevsetFilterPredicate), AsFilter(Rc<Self>), AtOperation { operation: St::Operation, candidates: Rc<Self>, }, WithinReference { candidates: Rc<Self>, commits: Vec<CommitId>, }, WithinVisibility { candidates: Rc<Self>, visible_heads: Vec<CommitId>, }, Coalesce(Rc<Self>, Rc<Self>), Present(Rc<Self>), NotIn(Rc<Self>), Union(Rc<Self>, Rc<Self>), Intersection(Rc<Self>, Rc<Self>), Difference(Rc<Self>, Rc<Self>),
}
Expand description

Tree of revset expressions describing DAG operations.

Use UserRevsetExpression or ResolvedRevsetExpression to construct expression of that state.

Variants§

§

None

§

All

§

VisibleHeads

§

VisibleHeadsOrReferenced

Visible heads and all referenced commits within the current expression scope. Used as the default of Range/DagRange heads.

§

Root

§

Commits(Vec<CommitId>)

§

CommitRef(St::CommitRef)

§

Ancestors

Fields

§heads: Rc<Self>
§generation: Range<u64>
§

Descendants

Fields

§roots: Rc<Self>
§generation: Range<u64>
§

Range

Fields

§roots: Rc<Self>
§heads: Rc<Self>
§generation: Range<u64>
§

DagRange

Fields

§roots: Rc<Self>
§heads: Rc<Self>
§

Reachable

Fields

§sources: Rc<Self>
§domain: Rc<Self>
§

Heads(Rc<Self>)

§

HeadsRange

Heads of the set of commits which are ancestors of heads but are not ancestors of roots, and which also are contained in filter.

Fields

§roots: Rc<Self>
§heads: Rc<Self>
§filter: Rc<Self>
§

Roots(Rc<Self>)

§

ForkPoint(Rc<Self>)

§

Latest

Fields

§candidates: Rc<Self>
§count: usize
§

Filter(RevsetFilterPredicate)

§

AsFilter(Rc<Self>)

Marker for subtree that should be intersected as filter.

§

AtOperation

Resolves symbols and visibility at the specified operation.

Fields

§operation: St::Operation
§candidates: Rc<Self>
§

WithinReference

Makes All include the commits and their ancestors in addition to the visible heads.

Fields

§candidates: Rc<Self>
§commits: Vec<CommitId>

Commits explicitly referenced within the scope.

§

WithinVisibility

Resolves visibility within the specified repo state.

Fields

§candidates: Rc<Self>
§visible_heads: Vec<CommitId>

Copy of repo.view().heads() at the operation.

§

Coalesce(Rc<Self>, Rc<Self>)

§

Present(Rc<Self>)

§

NotIn(Rc<Self>)

§

Union(Rc<Self>, Rc<Self>)

§

Intersection(Rc<Self>, Rc<Self>)

§

Difference(Rc<Self>, Rc<Self>)

Implementations§

Source§

impl<St: ExpressionState> RevsetExpression<St>

Source

pub fn none() -> Rc<Self>

Source

pub fn all() -> Rc<Self>

Ancestors of visible heads and all referenced commits within the current expression scope, which may include hidden commits.

Source

pub fn visible_heads() -> Rc<Self>

Source

pub fn root() -> Rc<Self>

Source

pub fn commit(commit_id: CommitId) -> Rc<Self>

Source

pub fn commits(commit_ids: Vec<CommitId>) -> Rc<Self>

Source

pub fn filter(predicate: RevsetFilterPredicate) -> Rc<Self>

Source

pub fn is_empty() -> Rc<Self>

Find any empty commits.

Source§

impl<St: ExpressionState<CommitRef = RevsetCommitRef>> RevsetExpression<St>

Source

pub fn working_copy(name: WorkspaceNameBuf) -> Rc<Self>

Source

pub fn working_copies() -> Rc<Self>

Source

pub fn symbol(value: String) -> Rc<Self>

Source

pub fn remote_symbol(value: RemoteRefSymbolBuf) -> Rc<Self>

Source

pub fn change_id_prefix(prefix: HexPrefix) -> Rc<Self>

Source

pub fn commit_id_prefix(prefix: HexPrefix) -> Rc<Self>

Source

pub fn bookmarks(pattern: StringPattern) -> Rc<Self>

Source

pub fn remote_bookmarks( bookmark_pattern: StringPattern, remote_pattern: StringPattern, remote_ref_state: Option<RemoteRefState>, ) -> Rc<Self>

Source

pub fn tags(pattern: StringPattern) -> Rc<Self>

Source

pub fn git_refs() -> Rc<Self>

Source

pub fn git_head() -> Rc<Self>

Source§

impl<St: ExpressionState> RevsetExpression<St>

Source

pub fn latest(self: &Rc<Self>, count: usize) -> Rc<Self>

Source

pub fn heads(self: &Rc<Self>) -> Rc<Self>

Commits in self that don’t have descendants in self.

Source

pub fn roots(self: &Rc<Self>) -> Rc<Self>

Commits in self that don’t have ancestors in self.

Source

pub fn parents(self: &Rc<Self>) -> Rc<Self>

Parents of self.

Source

pub fn ancestors(self: &Rc<Self>) -> Rc<Self>

Ancestors of self, including self.

Source

pub fn ancestors_at(self: &Rc<Self>, generation: u64) -> Rc<Self>

Ancestors of self at an offset of generation behind self. The generation offset is zero-based starting from self.

Source

pub fn ancestors_range( self: &Rc<Self>, generation_range: Range<u64>, ) -> Rc<Self>

Ancestors of self in the given range.

Source

pub fn children(self: &Rc<Self>) -> Rc<Self>

Children of self.

Source

pub fn descendants(self: &Rc<Self>) -> Rc<Self>

Descendants of self, including self.

Source

pub fn descendants_at(self: &Rc<Self>, generation: u64) -> Rc<Self>

Descendants of self at an offset of generation ahead of self. The generation offset is zero-based starting from self.

Source

pub fn descendants_range( self: &Rc<Self>, generation_range: Range<u64>, ) -> Rc<Self>

Descendants of self in the given range.

Source

pub fn fork_point(self: &Rc<Self>) -> Rc<Self>

Fork point (best common ancestors) of self.

Source

pub fn filtered(self: &Rc<Self>, predicate: RevsetFilterPredicate) -> Rc<Self>

Filter all commits by predicate in self.

Source

pub fn dag_range_to(self: &Rc<Self>, heads: &Rc<Self>) -> Rc<Self>

Commits that are descendants of self and ancestors of heads, both inclusive.

Source

pub fn connected(self: &Rc<Self>) -> Rc<Self>

Connects any ancestors and descendants in the set by adding the commits between them.

Source

pub fn reachable(self: &Rc<Self>, domain: &Rc<Self>) -> Rc<Self>

All commits within domain reachable from this set of commits, by traversing either parent or child edges.

Source

pub fn range(self: &Rc<Self>, heads: &Rc<Self>) -> Rc<Self>

Commits reachable from heads but not from self.

Source

pub fn present(self: &Rc<Self>) -> Rc<Self>

Suppresses name resolution error within self.

Source

pub fn negated(self: &Rc<Self>) -> Rc<Self>

Commits that are not in self, i.e. the complement of self.

Source

pub fn union(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>

Commits that are in self or in other (or both).

Source

pub fn union_all(expressions: &[Rc<Self>]) -> Rc<Self>

Commits that are in any of the expressions.

Source

pub fn intersection(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>

Commits that are in self and in other.

Source

pub fn minus(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>

Commits that are in self but not in other.

Source

pub fn coalesce(expressions: &[Rc<Self>]) -> Rc<Self>

Commits that are in the first expression in expressions that is not none().

Source§

impl<St: ExpressionState<CommitRef = RevsetCommitRef>> RevsetExpression<St>

Source

pub fn as_symbol(&self) -> Option<&str>

Returns symbol string if this expression is of that type.

Source§

impl RevsetExpression<UserExpressionState>

Source

pub fn resolve_user_expression( &self, repo: &dyn Repo, symbol_resolver: &SymbolResolver<'_>, ) -> Result<Rc<ResolvedRevsetExpression>, RevsetResolutionError>

Resolve a user-provided expression. Symbols will be resolved using the provided SymbolResolver.

Source§

impl RevsetExpression<ResolvedExpressionState>

Source

pub fn evaluate<'index>( self: Rc<Self>, repo: &'index dyn Repo, ) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>

Optimizes and evaluates this expression.

Source

pub fn evaluate_unoptimized<'index>( self: &Rc<Self>, repo: &'index dyn Repo, ) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>

Evaluates this expression without optimizing it.

Use this function if self is already optimized, or to debug optimization pass.

Source

pub fn to_backend_expression(&self, repo: &dyn Repo) -> ResolvedExpression

Transforms this expression to the form which the Index backend will process.

Trait Implementations§

Source§

impl<St: Clone + ExpressionState> Clone for RevsetExpression<St>
where St::CommitRef: Clone, St::Operation: Clone,

Source§

fn clone(&self) -> RevsetExpression<St>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<St: Debug + ExpressionState> Debug for RevsetExpression<St>
where St::CommitRef: Debug, St::Operation: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<St> Freeze for RevsetExpression<St>
where <St as ExpressionState>::CommitRef: Freeze, <St as ExpressionState>::Operation: Freeze,

§

impl<St> !RefUnwindSafe for RevsetExpression<St>

§

impl<St> !Send for RevsetExpression<St>

§

impl<St> !Sync for RevsetExpression<St>

§

impl<St> Unpin for RevsetExpression<St>
where <St as ExpressionState>::CommitRef: Unpin, <St as ExpressionState>::Operation: Unpin,

§

impl<St> !UnwindSafe for RevsetExpression<St>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,