Mercurial > hg
annotate rust/hg-core/src/dirstate_tree.rs @ 47096:3c11c24b82b6
dirstate-tree: Add `WithBasename` wrapper for `HgPath`
In the tree-shaped dirstate we want to have nodes representing files or
directories, where directory nodes contain a map associating "base" names
to child nodes for child files and directories.
Many dirstate operations expect a full path from the repository root, but
re-concatenating string from nested map keys all the time might be expensive.
Instead, `WithBasename` stores a full path for these operations but
behaves as its base name (last path component) for equality and comparison.
Additionally `inclusive_ancestors` provides the successive map keys
that are needed when inserting a new dirstate node at a given full path.
Differential Revision: https://phab.mercurial-scm.org/D10365
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 08 Apr 2021 20:12:24 +0200 |
parents | 473abf4728bf |
children | d5956136d19d |
rev | line source |
---|---|
47095
473abf4728bf
dirstate-tree: Empty shell for a second Rust DirstateMap implementation
Simon Sapin <simon.sapin@octobus.net>
parents:
47093
diff
changeset
|
1 pub mod dirstate_map; |
47093
787ff5d21bcd
dirstate-tree: Make Rust DirstateMap bindings go through a trait object
Simon Sapin <simon.sapin@octobus.net>
parents:
diff
changeset
|
2 pub mod dispatch; |
47096
3c11c24b82b6
dirstate-tree: Add `WithBasename` wrapper for `HgPath`
Simon Sapin <simon.sapin@octobus.net>
parents:
47095
diff
changeset
|
3 pub mod path_with_basename; |