discovery: move handling of sampling special case inside sampling function
The handling of cases where the number of revisions to sample is smaller than
the sample size can be moved with the sample function themselves. This
simplifies main logic, preparing a coming refactoring.
discovery: minor fix to some conditionals
Since `size` is the upper limit of the sample, we should include it in the
check. Otherwize the `more` variable will be zero and the sampling will be
useless
delta: reuse _findsnapshot call from previous stage
Two different stage of the sparse-revlog logic needs the _findsnapshot data.
To avoid recomputing it twice, make it possible to reuse the first computation
in the second step.
example affected manifest write
before: 0.067141s
after: 0.064252s (-5%)
(total gain since start of series: 95%)
delta: have a native implementation of _findsnapshot
The function might traverse a lot of revision, a native implementation get
significantly faster.
example affected manifest write
before: 0.114989
after: 0.067141 (-42%)
transaction: do not overwrite atomic-temp files on error
Even though the original files can be restored from the backup, it should be
better to not write back a temporary file if we know it can be corrupted.
rust: use 'impl Trait' in method argument of AncestorsIterator
I just didn't know it's stabilized. Let's switch to new convenient syntax.
Differential Revision: https://phab.mercurial-scm.org/D5451
rust: use .rev() for reverse range
Differential Revision: https://phab.mercurial-scm.org/D5450
histedit: add warning message on editing tagged commits (
issue4017)
Differential Revision: https://phab.mercurial-scm.org/D5489
strip: extract bookmark movement into a separate function
We will need it for the soft-strip case.