Mercurial > hg
diff rust/hg-core/src/dirstate.rs @ 47683:284a20269a97
dirstate-v2: Separate iterators for dirfoldmap and debugdirstate
`dirstatemap.dirfoldmap` was recently changed to re-use a Rust iterator
that was added for the `hg debugdirstate` command.
That iterator was based on all nodes in the tree dirstate without an entry
only existing to hold child nodes, and therefore being directories.
However to optimize status further we may want to store additional nodes
for unknown or ignored files and directories. At that point the two users
of this iterator will want different things, so let’s make two iterators
instead.
See doc-comments in `dispatch.rs`.
Differential Revision: https://phab.mercurial-scm.org/D11099
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Fri, 16 Jul 2021 14:08:26 +0200 |
parents | abed645b8e96 |
children | 81aedf1fc897 |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate.rs Thu Jul 15 23:02:17 2021 +0200 +++ b/rust/hg-core/src/dirstate.rs Fri Jul 16 14:08:26 2021 +0200 @@ -65,6 +65,12 @@ let fs_exec_bit = filesystem_metadata.mode() & EXEC_BIT_MASK; dirstate_exec_bit != fs_exec_bit } + + /// Returns a `(state, mode, size, mtime)` tuple as for + /// `DirstateMapMethods::debug_iter`. + pub fn debug_tuple(&self) -> (u8, i32, i32, i32) { + (self.state.into(), self.mode, self.size, self.mtime) + } } #[derive(BytesCast)]