- Feb 21, 2025
-
-
Mitchell Kember authored
This means that lints configured in rust/Cargo.toml will apply to all crates within the workspace. Currently there are none but I plan to add some.
-
Raphaël Gomès authored
Same as the previous patch, this is just dumb performance loss.
-
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 18, 2025
-
-
Raphaël Gomès authored
This is the last module left to migrate to PyO3 from rust-cpython. We will remove the rust-cpython code at the start of the next cycle.
-
Raphaël Gomès authored
This is a transliteration of the `update` module from `hg-cpython`.
-
Raphaël Gomès authored
This will host all repo-related operations. For now, this only contains the transliteration of the `repo_from_path` util from `hg-cpython`, but will later probably grow.
-
Raphaël Gomès authored
This is going to be useful for the upcoming `update` module, and is the transliteration of the util of the same name in `hg-cpython`. Explanations are inline.
-
Raphaël Gomès authored
This is going to be useful in more high-level modules like the upcoming `update` module.
-
Raphaël Gomès authored
PyO3 overrides the `__doc__` attributes to use the module's docstring.
-
Raphaël Gomès authored
-
- Feb 07, 2025
-
-
Mitchell Kember authored
This adds support to rhg annotate for all the whitespace options: -w, --ignore-all-space -b, --ignore-space-change -B, --ignore-blank-lines -Z, --ignore-space-at-eol Note that --ignore-blank-lines has no effect on annotate so it is ignored. You can see this in dagop.py _annotepair which only checks if blocks are '=' or not, whereas the effect of --ignore-blank-lines is to change some '!' into '~'. When the other 3 are combined, we use the strongest option since -w implies -b and -b implies -Z. This is not explicit in the Python implementation, but I have verified that's how it behaves.
-
- Feb 18, 2025
-
-
Pierre-Yves David authored
-
- Feb 13, 2025
-
-
Raphaël Gomès authored
The code (especially the Rust code) was jumping in 4 dimensions to make sense of what was going on because it wrongly assumed that we needed to somehow be able to ask a generaldelta index for a non-generaldelta delta chain, which doesn't make any sense. Removing the cargo-culted/vestigial code, this is cleaner and less confusing.
-
- Feb 06, 2025
-
-
Georges Racinet authored
This finally makes use of the latest `path` utilities. As a side note, `paths_py_list` cannot use `PyHgPathRef` itself because by calling `as_ref()` it would make the compiler believe it returns code owner by the inner `map` closure. Also, `status_path_py_list(py, &status_res.modified)?` can probably be replaced by ``` PyList::new(status_res.modified.iter().map(|p| PyHgPathRef(p)))? ``` with (granted) little benefit, but it could spare us a new utility each time there is a new collection type to return.
-
- Feb 05, 2025
-
-
Georges Racinet authored
-
Georges Racinet authored
We hesitated on this one: was it worth it to introduce the `with_inner_*` helpers? Finally quickness and uniformity decided we should. At this point it would be interesting to do something in `pyo3-sharedref` to provide them automatically, but some callers will need the self reference (as in `revlog`), some would not.
-
- Feb 04, 2025
-
-
Georges Racinet authored
-
Georges Racinet authored
This requires yet another `Sync` marker in `hg-core`. Of course we are leveraging the new `py_shared_iterator!` for this.
-
Georges Racinet authored
It turns out that it is fairly easy to call the core `DirstateMap` methods from a `CopyMap` PyO3 object, hence we do not need to introduce proxy methods on the FFI `DirstateMap` as was done in `rust-cpython`. It is more straightforward, and is somewhat easier to make with PyO3 because we have all these intermediates between the Rust and Python layers (`Bound`, `Py<T>`). From the Python side, a difference with the `hg-cpython` version is that `CopyMap` would be instantiable also directly as `CopyMap(dirstate_map)`. Reproducing the `from_inner`, with refcount increase the responsibility in the `DirstateMap.copymap()` method would have been less natural (as there is no need with the separate `from_inner` in PyO3 constructors) and somehow we felt it was sounder to force the ref cloning from `CopyMap`.
-
- Jan 30, 2025
-
-
Georges Racinet authored
Here we noticed a discrepancy in the truncated timestamps with what `DirstateItem` uses. More domain knowledge would be needed to decide whether it is normal or it would require some cleanup.
-
- Feb 05, 2025
-
-
Georges Racinet authored
This may seem trivial, but it allows to use `map_err(to_string_value_error)` in many places, instead of defining a closure `map_err(|e| PyValueError::new_err(e.to_string())`, and it is much better for readability.
-
- Feb 06, 2025
-
-
Georges Racinet authored
The `PyHgPathDirstateV2Result` new type is unfortunately heavily named, but it should allow for very straightforward conversions of collections.
-
- Jan 29, 2025
-
-
Georges Racinet authored
Pretty straightforward with `py_shared_iterator!`.
-
- Feb 04, 2025
-
-
Georges Racinet authored
This convenience will help reducing the boilerplate for one of the most common use cases of the `pyo3_sharedref` crate. It is an improved adaptation of a similar macro that was in `hg-cpython` (but not in `rust-cpython`). The improvement is that it takes care of the constructor, sparing the `share_map` to the caller.
-
- Jan 29, 2025
-
-
Georges Racinet authored
This takes care of all read-only methods except: - copymap methods - methods returning iterators These two categories will be done in forthcoming changesets.
-
- Feb 06, 2025
-
-
Georges Racinet authored
Same as `PyRevision`, the `PyHgPathRef` new-type wrapper is not a Python type, but it implements `IntoPyObject`, which will spare us tedious uses of `PyBytes::new`. The `paths_py_list` function is the the analog of `revs_py_list` for paths. There was one similar utility in `hg-cpython`, within the `dirstate::status` module. We feel it should be in a more global location, and have a name consistent with utilities for revisions. The `paths_pyiter_collect` function is similarly the analog of `revs_pyiter_collect`.
-
- Jan 29, 2025
-
-
Georges Racinet authored
With rust-cpython, using `Option<T>` in the Rust signature would translate automatically into a Python keyword argument, leading to unpleasantness on the Rust side in some cases (not here, though). with PyO3, though the signature can be specified explicitly (positional in this case) and there is even a warning that the implicit keywords style is deprecated.
-
- Feb 06, 2025
-
-
Georges Racinet authored
It will be simpler to go through the `PyNode` new-type, than to call `PyBytes::new(py, node.as_bytes())`. This also opens up many implicit usages, e.g, by `PyList::new` and the various "protocol" methods `PyAnyMethods::set_item`. Also we made the inner `Node` public because we feel `PyNode(n)` to be nicer than `n.into::<PyNode>()` as typically a bare `n.into()` will not be enough for `into_pyobject()` to know what to do.
-
- Jan 29, 2025
-
-
Georges Racinet authored
The rust-cpython version was using `Cell`, which is not `Sync`, hence we replace it with the pervasive `RwLock`. This brings in turn some minor simplification, as we can access a mutable reference to the inner data directly, and do not need the `update()` method (a shortcut to perform the `get`/`set` dance of the `Cell`). Tighter signature control in PyO3 means that `set_fallback_exec` can probably be simplified, which we might do once everything is validated by the tests.
-
Georges Racinet authored
-
Georges Racinet authored
-
Georges Racinet authored
This parallels what we have done earlier with the version in rust-cpython. It was not needed until now because the previous use of this struct was in `InnerRevlog` for the single revision cache, and which is shielded in `hg-core` behind a `Mutex`. But `DirstateMap` is needing its `owner` to be `Sync` more directly. In turn it means that maybe we could remove the `Mutex` of `hg-core`.
-
Georges Racinet authored
For the purposes of providing PyO3 bindings, the data fields that will be exposed to Python have to be `Sync`, hence that is the case of `OwningDirstateMap` and its `owner` field. We had to do something similar for the PyO3 bindings of `revlog`. In this case, it forces us to adapt the `Deref` wrapper of `PyBytes` used in `hg-cpython`, because it must itself now be `Sync` and raw pointers are not. This looks even uglier than it used to, but it does not matter much, because our ultimate goal is to remove the rust-cpython bindings altogether.
-
- Jan 24, 2025
-
-
Georges Racinet authored
-
Georges Racinet authored
-
- Jan 07, 2025
-
-
Raphaël Gomès authored
Unfortunately, the `static_assertions` crate has never been updated past its 1.1.0 release, meaning we don't get the (now 5+ years old) change that allows us to use generic parameters, so we use `static_assertions_next`.
-
- Jan 06, 2025
-
-
Raphaël Gomès authored
This is useful when debugging/light instrumentation, we already use it all the time in other packages.
-
- Jan 05, 2025
-
-
Raphaël Gomès authored
This is the convention in the rust code, since all other places are plural.
-
- Jan 07, 2025
-
-
Raphaël Gomès authored
These dependencies are not needed anymore, so trim them down.
-
Raphaël Gomès authored
This was unvaluable during the start of the transition period, but is useless now that the `InnerRevlog` translation is over.
-