pub enum RevsetExpression {
Show 24 variants
None,
All,
VisibleHeads,
Root,
Commits(Vec<CommitId>),
CommitRef(RevsetCommitRef),
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>),
Roots(Rc<Self>),
Latest {
candidates: Rc<Self>,
count: usize,
},
Filter(RevsetFilterPredicate),
AsFilter(Rc<Self>),
AtOperation {
operation: String,
candidates: Rc<Self>,
},
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>),
}
Variants§
None
All
VisibleHeads
Root
Commits(Vec<CommitId>)
CommitRef(RevsetCommitRef)
Ancestors
Descendants
Range
DagRange
Reachable
Heads(Rc<Self>)
Roots(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.
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 RevsetExpression
impl RevsetExpression
pub fn none() -> Rc<Self>
pub fn all() -> Rc<Self>
pub fn working_copy(workspace_id: WorkspaceId) -> Rc<Self>
pub fn working_copies() -> Rc<Self>
pub fn symbol(value: String) -> Rc<Self>
pub fn remote_symbol(name: String, remote: String) -> Rc<Self>
pub fn commit(commit_id: CommitId) -> Rc<Self>
pub fn commits(commit_ids: Vec<CommitId>) -> Rc<Self>
pub fn visible_heads() -> Rc<Self>
pub fn root() -> 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>
pub fn latest(self: &Rc<Self>, count: usize) -> Rc<Self>
pub fn filter(predicate: RevsetFilterPredicate) -> 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 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
.
Sourcepub fn minus(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>
pub fn minus(self: &Rc<Self>, other: &Rc<Self>) -> Rc<Self>
Commits that are in self
but not in other
.
Sourcepub fn coalesce(expressions: &[Rc<Self>]) -> Rc<Self>
pub fn coalesce(expressions: &[Rc<Self>]) -> Rc<Self>
Commits that are in the first expression in expressions
that is not
none()
.
Sourcepub fn as_symbol(&self) -> Option<&str>
pub fn as_symbol(&self) -> Option<&str>
Returns symbol string if this expression is of that type.
Sourcepub fn resolve_programmatic(
self: Rc<Self>,
repo: &dyn Repo,
) -> ResolvedExpression
pub fn resolve_programmatic( self: Rc<Self>, repo: &dyn Repo, ) -> ResolvedExpression
Resolve a programmatically created revset expression.
In particular, the expression must not contain any symbols (bookmarks,
tags, change/commit prefixes). Callers must not include
RevsetExpression::symbol()
in the expression, and should instead
resolve symbols to CommitId
s and pass them into
RevsetExpression::commits()
. Similarly, the expression must not
contain any RevsetExpression::remote_symbol()
or
RevsetExpression::working_copy()
, unless they’re known to be valid.
The expression must not contain RevsetExpression::AtOperation
even if
it’s known to be valid. It can fail at loading operation data.
Sourcepub fn resolve_user_expression(
self: Rc<Self>,
repo: &dyn Repo,
symbol_resolver: &dyn SymbolResolver,
) -> Result<ResolvedExpression, RevsetResolutionError>
pub fn resolve_user_expression( self: Rc<Self>, repo: &dyn Repo, symbol_resolver: &dyn SymbolResolver, ) -> Result<ResolvedExpression, RevsetResolutionError>
Resolve a user-provided expression. Symbols will be resolved using the
provided SymbolResolver
.
Sourcepub fn evaluate_programmatic<'index>(
self: Rc<Self>,
repo: &'index dyn Repo,
) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>
pub fn evaluate_programmatic<'index>( self: Rc<Self>, repo: &'index dyn Repo, ) -> Result<Box<dyn Revset + 'index>, RevsetEvaluationError>
Resolve a programmatically created revset expression and evaluate it in the repo.
Trait Implementations§
Source§impl Clone for RevsetExpression
impl Clone for RevsetExpression
Source§fn clone(&self) -> RevsetExpression
fn clone(&self) -> RevsetExpression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for RevsetExpression
impl !RefUnwindSafe for RevsetExpression
impl !Send for RevsetExpression
impl !Sync for RevsetExpression
impl Unpin for RevsetExpression
impl !UnwindSafe for RevsetExpression
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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