Skip to main content

ProcessEntryState

Struct ProcessEntryState 

Source
pub struct ProcessEntryState {
Show 16 fields pub source_index: Option<usize>, pub target_index: usize, pub include_unchanged: bool, pub want_unversioned: bool, pub partial: bool, pub supports_tree_reference: bool, pub root_abspath: Vec<u8>, pub searched_specific_files: HashSet<Vec<u8>>, pub search_specific_files: HashSet<Vec<u8>>, pub search_specific_file_parents: HashSet<Vec<u8>>, pub searched_exact_paths: HashSet<Vec<u8>>, pub seen_ids: HashSet<Vec<u8>>, pub new_dirname_to_file_id: HashMap<Vec<u8>, Vec<u8>>, pub old_dirname_to_file_id: HashMap<Vec<u8>, Vec<u8>>, pub last_source_parent: Option<(Vec<u8>, Option<Vec<u8>>)>, pub last_target_parent: Option<(Vec<u8>, Option<Vec<u8>>)>,
}
Expand description

Mutable per-iter_changes state shared across super::DirState::process_entry calls. Ports the instance fields Python’s ProcessEntryPython carries: search / searched sets, parent-id caches, dirname-to-file-id maps.

Fields§

§source_index: Option<usize>

source_index in the tree-data array; None means “compare against a synthetic empty source” (new-tree mode).

§target_index: usize

target_index in the tree-data array; always concrete.

§include_unchanged: bool

Whether unchanged entries should still yield a change tuple.

§want_unversioned: bool

Whether the iter_changes caller wants reports for paths on disk that aren’t in either source or target dirstate trees.

§partial: bool

Partial iter_changes: true when the caller supplied a narrower set of paths than {b""}. Used by _gather_result_for_consistency to decide whether to queue parent-directory bookkeeping.

§supports_tree_reference: bool

Whether the current working-tree format supports tree references. When false, is_tree_reference_dir is never called during the walk.

§root_abspath: Vec<u8>

Absolute path of the working-tree root on disk. Used to join root + relpath into an absolute path that Transport methods can accept. Filled at iter_changes call time.

§searched_specific_files: HashSet<Vec<u8>>

Paths whose children have already been walked.

§search_specific_files: HashSet<Vec<u8>>

Paths whose children still need walking (driven by the outer iter_changes loop).

§search_specific_file_parents: HashSet<Vec<u8>>

Parent directories we need to re-visit after the main walk — populated by _gather_result_for_consistency when a partial iter_changes produces a relocated entry.

§searched_exact_paths: HashSet<Vec<u8>>

Paths we’ve examined via _iter_specific_file_parents.

§seen_ids: HashSet<Vec<u8>>

File ids we’ve already yielded during the main walk.

§new_dirname_to_file_id: HashMap<Vec<u8>, Vec<u8>>

Cache: dirname → file_id for the target tree.

§old_dirname_to_file_id: HashMap<Vec<u8>, Vec<u8>>

Cache: dirname → file_id for the source tree.

§last_source_parent: Option<(Vec<u8>, Option<Vec<u8>>)>

One-slot cache: (dirname, parent_file_id) for the source tree.

§last_target_parent: Option<(Vec<u8>, Option<Vec<u8>>)>

One-slot cache: (dirname, parent_file_id) for the target tree.

Trait Implementations§

Source§

impl Debug for ProcessEntryState

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ProcessEntryState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> Ungil for T
where T: Send,