rust-discovery: exposing sampling to python
Differential Revision: https://phab.mercurial-scm.org/D6425
tests: use `tr -d` and not `tr --delete` as the latter is absent on BSD tr(1)
Differential Revision: https://phab.mercurial-scm.org/D6729
rust-discovery: takefullsample() core implementation
take_full_sample() browses the undecided set in both directions: from
its roots as well as from its heads.
Following what's done on the Python side, we alter update_sample()
signature to take a closure returning an iterator: either ParentsIterator
or an iterator over the children found in `children_cache`. These constructs
should probably be split off in a separate module.
This is a first concrete example where a more abstract graph notion (probably
a trait) would be useful, as this is nothing but an operation on the reversed
DAG.
A similar motivation in the context of the discovery
process would be to replace the call to dagops::range in
`add_missing_revisions()` with a simple iteration over descendents, again an
operation on the reversed graph.
Differential Revision: https://phab.mercurial-scm.org/D6424
rust-discovery: core implementation for take_quick_sample()
This makes in particular `rand` no longer a testing dependency.
We keep a seedable random generator on the `PartialDiscovery` object
itself, to avoid lengthy initialization.
In take_quick_sample() itself, we had to avoid keeping the reference
to `self.undecided` to cope with the mutable reference introduced
by the the call to `limit_sample`, but it's still manageable without
resorting to inner mutability.
Sampling being prone to be improved in the mid-term future, testing
is minimal, amounting to checking which code path got executed.
Differential Revision: https://phab.mercurial-scm.org/D6423
rust-discovery: read the index from a repo passed at init
This makes the API of the Rust PartialDiscovery object now
the same (or rather a subset) of the Python object, hence
easier to control through module policy down the road.
Differential Revision: https://phab.mercurial-scm.org/D6517
rust-discovery: accept the new 'respectsize' init arg
At this stage, we don't do anything about it: it will be meaningful
in sampling methods that aren't implemented yet.
Differential Revision: https://phab.mercurial-scm.org/D6516
unshelve: forget unknown files after a partial unshelve
This is a follow-up patch to
6957f7b93e03. This allows hg to forget
unknown files after a partial unshelve.
Differential Revision: https://phab.mercurial-scm.org/D6724