In order to allow the python interface code to perform actions on each node in
the tree without creating python-specific interfaces in the generic Rust code,
add a method of iterating over the tree, executing a closure at each file.
Use this to implement the methods that give iterators over the filenames in the
tree. This performs better than the get_first/get_next-style iterators.
Differential Revision: https://phab.mercurial-scm.org/D1403
Iterations over all files will cause most of the file to be read in a piecemeal
fashion. This will be inefficient on disks with slow seek times. Instead,
read the whole file into memory before iterating.
Differential Revision: https://phab.mercurial-scm.org/D1402
Adds FileStore, an implementation of the Store and StoreView traits that uses a
file on disk to store the data, and reads and writes blocks using file I/O.
Differential Revision: https://phab.mercurial-scm.org/D1398
These traits represent abstract store objects than can store arbitrary data
blocks with store-generated indexes.
A NullStore implementation is provided which acts an always-empty StoreView.
Differential Revision: https://phab.mercurial-scm.org/D1397
This adds an implementation of an ordered map that uses a vector pairs, sorted
by the key.
This is largely compatibly with std::collections::BTreeMap, but has performance
characteristics more suited for use in treedirstate.
Differential Revision: https://phab.mercurial-scm.org/D1396
Create an empty Rust project for treedirstate. This will be a
re-implementation of the dirstate map using a tree structure, where nodes in
the tree are directories, and leaves are files.
Differential Revision: https://phab.mercurial-scm.org/D1395