- Feb 21, 2025
-
-
Raphaël Gomès authored
This is... really dumb and costs a ton of performance in a hot loop. It was 75% of a profile for a tip to null p1 node traversal in pure Rust. I'm at fault, done in 652149ed64f0. I thought clippy had a lint for this, but apparently not?
-
- Feb 07, 2025
-
-
Mitchell Kember authored
This will be used in a follow-up commit that creates a data structure optimized for inserting revisions in descending order, since it will need to fail if a revision number is greater than its descendant (meaning the graph is corrupted).
-
- Jan 16, 2025
-
-
Mitchell Kember authored
This continues the work done in a3fa37bdb7ec, turning more methods into checked/unchecked pairs of methods.
-
- Jan 14, 2025
-
-
Mitchell Kember authored
This is similar to manifestctx.read_delta_parents(exact=False) in manifest.py. It is useful to determine if a file was added in a changeset without delta-resolving the entire manifest. I will use it for rhg annotate.
-
- Jan 03, 2025
-
-
Mitchell Kember authored
These will be needed for the implementation of rhg annotate.
-
- Nov 26, 2024
-
-
Arseniy Alekseyev authored
This brings the work started in `652149ed64f0` to its logical conclusion and makes the RevlogError self-sufficient so it can be directly converted to CommandError, without an extra rev text annotation. Without this change, it's confusing that the extra annotation is ignored in most-but-not-all cases.
-
- Oct 29, 2024
-
-
Raphaël Gomès authored
`open` being read *and* write is surprising because it differs from the Rust stdlib where `std::fs::File::open` is read-only by default. More importantly, writing is more dangerous than reading, so let's make it more explicit.
-
Raphaël Gomès authored
This normalizes the naming scheme between the `Revlog`, `Changelog`, etc. which is less suprising, though no real bugs could stem from this because of the type signature mismatch. The very high-level `Repo` object still uses an `UncheckedRevision` parameter for its methods because that's what most callers will want.
-
- Sep 26, 2024
-
-
Raphaël Gomès authored
This made a lot of the imports confusing because they didn't make sense at the top level (so, outside of `revlog`), and they hide the more common types when autocompleting.
-
- Aug 01, 2024
-
-
Raphaël Gomès authored
Same rationale as b619ba39d10a.
-
- Jul 31, 2024
-
-
Raphaël Gomès authored
It only uses index features and does not need to be on the revlog. A later patch will make use of this function from a different context.
-
- Jul 29, 2024
-
-
Raphaël Gomès authored
This will be used from Python in a later change. More changes are needed in hg-core and rhg to properly clean up the APIs of the old VFS implementation but it can be done when the dust settles and we start adding more functionality to the pure Rust VFS.
-
- Sep 26, 2024
-
-
Raphaël Gomès authored
See 522b4d729e89 for more details. Background population to follow in a later patch.
-
- Oct 10, 2024
-
-
Raphaël Gomès authored
This mirrors the Python `InnerRevlog` and will be used in a future patch to replace said Python implementation. This allows us to start doing more things in pure Rust, in particular reading and writing operations. A lot of changes have to be introduced all at once, it wouldn't be very useful to separate this patch IMO since all of them are either interlocked or only useful with the rest.
-
- Sep 25, 2024
-
-
Raphaël Gomès authored
This helps group all the relevant revlog options code and makes the `mod.rs` more readable.
-
Raphaël Gomès authored
This will be useful for the upcoming `InnerRevlog`.
-
Raphaël Gomès authored
This will be used in the upcoming `InnerRevlog` when reading/writing data.
-
- Oct 01, 2024
-
-
Raphaël Gomès authored
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 authored
I encountered this when debugging earlier and felt like we were losing some information along the way, which we were!
-
- Jun 19, 2024
-
-
Raphaël Gomès authored
This will allow for the use of multiple vfs like in the Python implementation, as well as hiding the details of the upcoming Python vfs wrapper to hg-core.
-
Raphaël Gomès authored
This centralizes the more complex logic needed for the upcoming code and creates stronger APIs with fewer booleans. We also reuse `RevlogType` where needed.
-
- Sep 17, 2024
-
-
Raphaël Gomès authored
This will cover the case where the data file is not present.
-
- Jun 19, 2024
-
-
Raphaël Gomès authored
These will be used by the upcoming Rust `InnerRevlog` to better centralize config information that is relevant to revlogs.
-
- May 06, 2024
-
-
Raphaël Gomès authored
-
- Apr 22, 2024
-
-
Georges Racinet authored
The need comes from the fact that `AncestorsIterator` and many Graph-related algorithms take ownership of the `Graph` they work with. This, in turn is due to them needing to accept the `Index` instances that are provided by the Python layers (that neither rhg nor `RHGitaly` use, of course): the fact that nowadays the Python layer holds an object that is itself implemented in Rust does not change the core problem that they cannot be tracked by the borrow checker. Even though it looks like cloning `Changelog` would be cheap, it seems hard to guarantee that on the long run. The object is already too rich for us to be comfortable with it, when using references is the most natural and guaranteed way of proceeding. The added test seems a bit superfleous, but it will act as a reminder that this feature is really useful until something in the Mercurial code base actually uses it.
-
- Feb 26, 2024
-
-
Pierre-Yves David authored
The inline `offsets` value diverge from the one on disk for added value, so the offset_override tricks is not going to work well once we start having the full revlog logic in Rust. We remove it beforehand and align the Rust logic to the Python one (adjusting the segment offset at read time for inline revlog).
-
Pierre-Yves David authored
We are not adding any data, so why are we setting any offset?
-
- Nov 23, 2023
-
-
Raphaël Gomès authored
-
- Nov 02, 2023
-
-
Raphaël Gomès authored
This is a temporary measure to show that both the Rust and C indexes are kept in sync. Comes with some related documentation precisions. For comparison of error cases, see `index_entry_binary()` in `revlog.c`.
-
- Sep 18, 2023
-
-
Raphaël Gomès authored
This will become necessary as we start writing revlog data from Rust.
-
- Nov 06, 2023
-
-
Raphaël Gomès authored
Our current version of clippy is older than the latest stable. The newest version has new lints that are moslty good advice, so let's apply them ahead of time. This has the added benefit of reducing the noise for developpers like myself that use clippy as an IDE helper, as well as being more prepared for a future clippy upgrade.
-
- Oct 11, 2023
-
-
Pierre-Yves David authored
-
- Sep 14, 2023
-
-
Arseniy Alekseyev authored
-
- Sep 13, 2023
-
-
Arseniy Alekseyev authored
The problem is that nodemap already takes care about NULL_NODE resolution (in `validate_candidate` in `nodemap.rs`), so the special handling in `rev_from_node` is unnecessary and incorrect.
-
- Aug 18, 2023
-
-
Raphaël Gomès authored
This change is the one we've been building towards during this series. The aim is to make `Revision` mean more than a simple integer, holding the information that it is valid for a given revlog index. While this still allows for programmer error, since creating a revision directly and querying a different index with a "checked" revision are still possible, the friction created by the newtype will hopefully make us think twice about which type to use. Enough of the Rust ecosystem relies on the newtype pattern to be efficiently optimized away (even compiler in codegen tests¹), so I'm not worried about this being a fundamental problem. [1] https://github.com/rust-lang/rust/blob/7a70647f195f6b0a0f1ebd72b1542ba91a32f43a/tests/codegen/vec-in-place.rs#L47
-
- Aug 10, 2023
-
-
Raphaël Gomès authored
This is trivial and makes all the algorithms relying on the trait usable for more use cases.
-
Raphaël Gomès authored
This step converts all revisions that shouldn't be considered "valid" in any context to `UncheckedRevison`, allowing `Revision` to be changed for a stronger type in a later changeset. Note that the conversion from unchecked to checked is manual and requires at least some thought from the programmer, although directly using `Revision` is still possible. A later changeset will make this mistake harder to make.
-
- Sep 11, 2023
-
-
Raphaël Gomès authored
In the next changeset, we will change the logic to use `UncheckedRevision` in the non-general delta case. The general delta case will use the "checked" path since `base_rev_or_base_of_delta_chain` will be checked.
-
- Aug 07, 2023
-
-
Raphaël Gomès authored
All paths check that the working directory revision is not used.
-
Raphaël Gomès authored
This is the start of a series whose aim is to separate "checked" and "unchecked" revision numbers. A "checked" revision number is valid for a given index, allowing us to have faster algorithms that don't do redundant checks all the time and have a clearer view of the kinds of revisions we're working with.
-