pub struct FileAnnotator { /* private fields */ }
Expand description
Annotation process for a specific file.
Implementations§
Source§impl FileAnnotator
impl FileAnnotator
Sourcepub fn from_commit(
starting_commit: &Commit,
file_path: &RepoPath,
) -> BackendResult<Self>
pub fn from_commit( starting_commit: &Commit, file_path: &RepoPath, ) -> BackendResult<Self>
Initializes annotator for a specific file in the starting_commit
.
If the file is not found, the result would be empty.
Sourcepub fn with_file_content(
starting_commit_id: &CommitId,
file_path: &RepoPath,
starting_text: impl Into<Vec<u8>>,
) -> Self
pub fn with_file_content( starting_commit_id: &CommitId, file_path: &RepoPath, starting_text: impl Into<Vec<u8>>, ) -> Self
Initializes annotator for a specific file path starting with the given content.
The file content at the starting_commit
is set to starting_text
.
This is typically one of the file contents in the conflict or
merged-parent tree.
Sourcepub fn compute(
&mut self,
repo: &dyn Repo,
domain: &Rc<ResolvedRevsetExpression>,
) -> Result<(), RevsetEvaluationError>
pub fn compute( &mut self, repo: &dyn Repo, domain: &Rc<ResolvedRevsetExpression>, ) -> Result<(), RevsetEvaluationError>
Computes line-by-line annotation within the domain
.
The domain
expression narrows the range of ancestors to search. It
will be intersected as domain & ::pending_commits & files(file_path)
.
The pending_commits
is assumed to be included in the domain
.
Sourcepub fn pending_commits(&self) -> impl Iterator<Item = &CommitId>
pub fn pending_commits(&self) -> impl Iterator<Item = &CommitId>
Remaining commit ids to visit from.
Sourcepub fn to_annotation(&self) -> FileAnnotation
pub fn to_annotation(&self) -> FileAnnotation
Returns the current state as line-oriented annotation.
Trait Implementations§
Source§impl Clone for FileAnnotator
impl Clone for FileAnnotator
Source§fn clone(&self) -> FileAnnotator
fn clone(&self) -> FileAnnotator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for FileAnnotator
impl RefUnwindSafe for FileAnnotator
impl Send for FileAnnotator
impl Sync for FileAnnotator
impl Unpin for FileAnnotator
impl UnwindSafe for FileAnnotator
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
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>
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 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>
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