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
Descendants
Range
DagRange
Reachable
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
.
Roots(Rc<Self>)
ForkPoint(Rc<Self>)
Latest
Filter(RevsetFilterPredicate)
AsFilter(Rc<Self>)
Marker for subtree that should be intersected as filter.
AtOperation
Resolves symbols and visibility at the specified operation.
WithinReference
Makes All
include the commits and their ancestors in addition to the
visible heads.
WithinVisibility
Resolves visibility within the specified repo state.
Fields
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>
impl<St: ExpressionState> RevsetExpression<St>
pub fn none() -> Rc<Self>
Sourcepub fn all() -> Rc<Self>
pub fn all() -> Rc<Self>
Ancestors of visible heads and all referenced commits within the current expression scope, which may include hidden commits.
pub fn visible_heads() -> Rc<Self>
pub fn root() -> Rc<Self>
pub fn commit(commit_id: CommitId) -> Rc<Self>
pub fn commits(commit_ids: Vec<CommitId>) -> Rc<Self>
pub fn filter(predicate: RevsetFilterPredicate) -> Rc<Self>
Source§impl<St: ExpressionState<CommitRef = RevsetCommitRef>> RevsetExpression<St>
impl<St: ExpressionState<CommitRef = RevsetCommitRef>> RevsetExpression<St>
pub fn working_copy(name: WorkspaceNameBuf) -> Rc<Self>
pub fn working_copies() -> Rc<Self>
pub fn symbol(value: String) -> Rc<Self>
pub fn remote_symbol(value: RemoteRefSymbolBuf) -> Rc<Self>
pub fn change_id_prefix(prefix: HexPrefix) -> Rc<Self>
pub fn commit_id_prefix(prefix: HexPrefix) -> Rc<Self>
pub fn bookmarks(pattern: StringPattern) -> Rc<Self>
pub fn remote_bookmarks( bookmark_pattern: StringPattern, remote_pattern: StringPattern, remote_ref_state: Option<RemoteRefState>, ) -> Rc<Self>
pub fn git_refs() -> Rc<Self>
pub fn git_head() -> Rc<Self>
Source§impl<St: ExpressionState> RevsetExpression<St>
impl<St: ExpressionState> RevsetExpression<St>
pub fn latest(self: &Rc<Self>, count: usize) -> Rc<Self>
Sourcepub fn ancestors_at(self: &Rc<Self>, generation: u64) -> Rc<Self>
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
.
Sourcepub fn ancestors_range(
self: &Rc<Self>,
generation_range: Range<u64>,
) -> Rc<Self>
pub fn ancestors_range( self: &Rc<Self>, generation_range: Range<u64>, ) -> Rc<Self>
Ancestors of self
in the given range.
Sourcepub fn descendants(self: &Rc<Self>) -> Rc<Self>
pub fn descendants(self: &Rc<Self>) -> Rc<Self>
Descendants of self
, including self
.
Sourcepub fn descendants_at(self: &Rc<Self>, generation: u64) -> Rc<Self>
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
.
Sourcepub fn descendants_range(
self: &Rc<Self>,
generation_range: Range<u64>,
) -> Rc<Self>
pub fn descendants_range( self: &Rc<Self>, generation_range: Range<u64>, ) -> Rc<Self>
Descendants of self
in the given range.
Sourcepub fn fork_point(self: &Rc<Self>) -> Rc<Self>
pub fn fork_point(self: &Rc<Self>) -> Rc<Self>
Fork point (best common ancestors) of self
.
Sourcepub fn filtered(self: &Rc<Self>, predicate: RevsetFilterPredicate) -> Rc<Self>
pub fn filtered(self: &Rc<Self>, predicate: RevsetFilterPredicate) -> Rc<Self>
Filter all commits by predicate
in self
.
Sourcepub fn dag_range_to(self: &Rc<Self>, heads: &Rc<Self>) -> Rc<Self>
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.
Sourcepub fn connected(self: &Rc<Self>) -> Rc<Self>
pub fn connected(self: &Rc<Self>) -> Rc<Self>
Connects any ancestors and descendants in the set by adding the commits between them.
Sourcepub fn reachable(self: &Rc<Self>, domain: &Rc<Self>) -> Rc<Self>
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.
Sourcepub fn range(self: &Rc<Self>, heads: &Rc<Self>) -> Rc<Self>
pub fn range(self: &Rc<Self>, heads: &Rc<Self>) -> Rc<Self>
Commits reachable from heads
but not from self
.
Sourcepub fn negated(self: &Rc<Self>) -> Rc<Self>
pub fn negated(self: &Rc<Self>) -> Rc<Self>
Commits that are not in self
, i.e. the complement of self
.
Sourcepub fn union(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>
pub fn union(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>
Commits that are in self
or in other
(or both).
Sourcepub fn union_all(expressions: &[Rc<Self>]) -> Rc<Self>
pub fn union_all(expressions: &[Rc<Self>]) -> Rc<Self>
Commits that are in any of the expressions
.
Sourcepub fn intersection(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>
pub fn intersection(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>
Commits that are in self
and in other
.
Source§impl<St: ExpressionState<CommitRef = RevsetCommitRef>> RevsetExpression<St>
impl<St: ExpressionState<CommitRef = RevsetCommitRef>> RevsetExpression<St>
Source§impl RevsetExpression<UserExpressionState>
impl RevsetExpression<UserExpressionState>
Sourcepub fn resolve_user_expression(
&self,
repo: &dyn Repo,
symbol_resolver: &SymbolResolver<'_>,
) -> Result<Rc<ResolvedRevsetExpression>, RevsetResolutionError>
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>
impl RevsetExpression<ResolvedExpressionState>
Sourcepub fn evaluate<'index>(
self: Rc<Self>,
repo: &'index dyn Repo,
) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>
pub fn evaluate<'index>( self: Rc<Self>, repo: &'index dyn Repo, ) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>
Optimizes and evaluates this expression.
Sourcepub fn evaluate_unoptimized<'index>(
self: &Rc<Self>,
repo: &'index dyn Repo,
) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>
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.
Sourcepub fn to_backend_expression(&self, repo: &dyn Repo) -> ResolvedExpression
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>
impl<St: Clone + ExpressionState> Clone for RevsetExpression<St>
Source§fn clone(&self) -> RevsetExpression<St>
fn clone(&self) -> RevsetExpression<St>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<St> Freeze for RevsetExpression<St>
impl<St> !RefUnwindSafe for RevsetExpression<St>
impl<St> !Send for RevsetExpression<St>
impl<St> !Sync for RevsetExpression<St>
impl<St> Unpin for RevsetExpression<St>
impl<St> !UnwindSafe for RevsetExpression<St>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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