Matt Harbison <matt_harbison@yahoo.com> [Wed, 23 Oct 2024 16:19:24 -0400] rev 52064
revlog: drop the CamelCase name for `revlog.revlogrevisiondelta`
These CamelCase names popped up this cycle because pytype was getting confused
by the zope decorator, and so the decoration was decoupled from the class
declaration. We're in the process of switching all of the zope interfaces to
`typing.Protocol` classes, but we're up against the code freeze. It would be
nice to use CamelCase for protocol classes (or classes in general), but let's
reset to a consistent state and buy some more time to think about this.
Since we're moving to Protocol classes and I disabled the interface tests back
in
ef7d85089952, I'm not bothering to re-add the decorator, and re-confuse
pytype. But do place the interface next to the class, so that these places can
be found with the `grep` when the time comes to subclass.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Oct 2024 16:14:13 +0200] rev 52063
tests: use pyflakes as a tool, not a python module
The usage of pyflakes as a Python module was introduced in
e397c6d74652, to work
around issue between Python 2 and Python 3. This issues are long behind us now
and we can get beck to using pyflakes as a tool, giving us more flexibility
about how we install it.
The `hghave` requirements is modified to check that we have a tool available,
instead of a python module.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 22 Oct 2024 15:50:47 +0200] rev 52062
clang-format: do not accept version above 19.x
This gives me different formatting on latest version available in Debian. So
disabling for now.
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 17:21:03 +0200] rev 52061
rust-update: add a config item to disable the Rust update fastpath
Explanations inline.
Raphaël Gomès <rgomes@octobus.net> [Tue, 01 Oct 2024 13:49:11 +0200] rev 52060
update: add a Rust fast-path when updating from null (and clean)
This case is easy to detect and we have all we need to generate a valid
working copy and dirstate entirely in Rust, which speeds things up
considerably:
On my machine updating a repo of ~300k files goes from 10.00s down to 4.2s,
all while consuming 50% less system time, with all caches hot.
Something to note is that further improvements will probably happen
with the upcoming `InnerRevlog` series that does smarter
mmap hanlding, especially for filelogs.
Here are benchmark numbers on a machine with only 4 cores (and no SMT enabled)
```
### data-env-vars.name = heptapod-public-2024-03-25-ds2-pnm
# benchmark.name = hg.command.update
# bin-env-vars.hg.py-re2-module = default
# bin-env-vars.hg.changeset.node = <this change>
# benchmark.variants.atomic-update = no
# benchmark.variants.scenario = null-to-tip
# benchmark.variants.worker = default
default: 5.328762 ~~~~~
rust: 1.308654 (-75.44%, -4.02)
### data-env-vars.name = mercurial-devel-2024-03-22-ds2-pnm
# benchmark.name = hg.command.update
# bin-env-vars.hg.py-re2-module = default
# bin-env-vars.hg.changeset.node = <this change>
# benchmark.variants.atomic-update = no
# benchmark.variants.scenario = null-to-tip
# benchmark.variants.worker = default
default: 1.693271 ~~~~~
rust: 1.151053 (-32.02%, -0.54)
### data-env-vars.name = mozilla-unified-2024-03-22-ds2-pnm
# benchmark.name = hg.command.update
# bin-env-vars.hg.py-re2-module = default
# bin-env-vars.hg.changeset.node = <this change>
# benchmark.variants.atomic-update = no
# benchmark.variants.scenario = null-to-tip
# benchmark.variants.worker = default
default: 38.901613 ~~~~~
rust: 11.637880 (-70.08%, -27.26)
### data-env-vars.name = netbsd-xsrc-public-2024-09-19-ds2-pnm
# benchmark.name = hg.command.update
# bin-env-vars.hg.py-re2-module = default
# bin-env-vars.hg.changeset.node = <this change>
# benchmark.variants.atomic-update = no
# benchmark.variants.scenario = null-to-tip
# benchmark.variants.worker = default
default: 4.793727 ~~~~~
rust: 1.505905 (-68.59%, -3.29)
```
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 19:14:30 +0200] rev 52059
merge: improve working-copy mtime race handling
Explanations inline. This also makes use of `make_mtime_reliable`, which
unifies our mtime raciness logic from the status.
On top of this, this fixes the handling of the pure dirstate status to better
catch racy status, as we've been doing in Rust for a long time now.
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 18:56:19 +0200] rev 52058
merge: move the filtering of ambiguous files to a dedicated function
I have multiple reasons:
- The body of `_update` is way too long
- This adds typing which will help our tooling and brains understand this
code more easily
- This function will get more nested and complex in the next patch
I've taken the liberty of rewrapping and typo-passing the docstring.
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 18:41:49 +0200] rev 52057
timestamp: make the reliable comparison more usable from outside
This is going to be used with pre-computed times unlike in status.
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 18:40:59 +0200] rev 52056
timestamp: add type information to the module
This is easy to do and helps both Pytype and developpers understand what
objects they are dealing with.
Raphaël Gomès <rgomes@octobus.net> [Wed, 16 Oct 2024 17:19:38 +0200] rev 52055
rust-dirstate: make the reliable timestamp comparison more usable from outside
This is going to be used with pre-computed times unlike in status.
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Oct 2024 16:35:31 +0200] rev 52054
rust-dirstate-map: use a more precise identity
This is closer to the behavior of what Python does. So far, we were checking
only the inode, but this might not be good enough for the v1 case.
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Oct 2024 14:14:21 +0200] rev 52053
dirstate-map: add a missing debug wait point when accessing the v2 docket
fc8e37c380d3 added synchronization points to the dirstate to allow for race
condition testing without actually requiring a time-based race condition
to happen.
This changes adds the `pre-read-file` wait point before we read the docket,
since callers might ask for the parents before anything else is
read, leading to the first read being done before the wait point.
This removes some differences in test output which were presumed to be
speed related, but weren't.
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Oct 2024 00:31:25 +0200] rev 52052
rust-parsers: use the same error message as with the higher-level code
This can happen at two places, but it's not really enough time to justify it
being refactored. Let's ensure we have the same error message, the newer one
being slightly more helpful.
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Oct 2024 01:52:44 +0200] rev 52051
rust-pathauditor: make sure we actually test the nested repo case
This covers the *on-disk* case, where the path itself does not have a `.hg`
component.
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 20:29:48 +0200] rev 52050
rust-pathauditor: match more of Python's behavior and display messages
We will make use of the path auditor when running our update fast-path,
and we want to output of it to be close enough.
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 18:31:32 +0200] rev 52049
rust-dirstate: pass dirstate tracked key from the requirements
We will make use of this with the `hg update` fastpath
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 13:39:43 +0200] rev 52048
rust-files: check for empty manifests caused by narrow
Explanations inline
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Oct 2024 13:36:51 +0200] rev 52047
rust-repo: don't use on-disk dirstate parents in v1
This mistake was not causing any problems yet since we were never updating
parents from Rust code. This is about to change, so let's fix it.
Raphaël Gomès <rgomes@octobus.net> [Tue, 01 Oct 2024 13:45:18 +0200] rev 52046
rust-cpython: add a util to get a `Repo` from a python path
I suspect this will not be the last time we need to do something like this.
Raphaël Gomès <rgomes@octobus.net> [Tue, 01 Oct 2024 13:20:40 +0200] rev 52045
rust: improve `InvalidRevision` error message
I encountered this when debugging earlier and felt like we were losing some
information along the way, which we were!
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 17:19:35 +0200] rev 52044
rust-dirstate: use a struct as arguments for the high-level `reset_state`
This makes the interface a lot clearer at the call site and prevents silly
mistakes, as an API with a bunch of booleans is prone to errors.
This refactor adds a `from_empty` parameter for a fast-path when resetting
and entry we're sure does not exist. It will be used in the upcoming update
Rust fastpath, and was not split to prevent more churn.
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 16:55:11 +0200] rev 52043
rust: implement `From<SparseConfigWarning>` for `HgError`
This will be useful in a future patch to avoid a lot of boilerplate.
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 16:04:51 +0200] rev 52042
rust-hg-cpython: add an `HgProgressBar` util
This will be the entry point for all progress bars from a Python context
in upcoming patches. Like the `Progress` trait, this is subject to change
once we have more use cases, but this is good enough for now.
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Sep 2024 16:02:30 +0200] rev 52041
rust: add `Progress` trait for progress bars
This will be used in the next few changes to introduce a progress bar for
the `hg update` fastpath.