- Feb 14, 2025
-
-
Mitchell Kember authored
This adds Config::username which returns HGUSER, ui.username, or EMAIL in that order, similar to ui.username() in Python. I considered following the pattern of EDITOR, VISUAL, PAGER, etc. and using add_for_environment_variable, but it's not possible to get the same precendence as in Python that way (in particular HGUSER coming after the repo .hg/hgrc), at least not without significant changes. This will be used for 'rhg annotate -r wdir() -u' to annotate the username on lines that were changed in the working directory.
-
- Jan 16, 2025
-
-
Mitchell Kember authored
This moves string-related functions in hg::utils into the recently added hg::utils::strings module.
-
- Jan 14, 2025
-
-
Mitchell Kember authored
This makes hg-core use ResourceProfileValue::Medium as the default. Before, it used ResourceProfileValue::Default (now removed), which was not supposed to be a real value, but rather an indirection meaning to use the default (medium). The motivation for this is that my implementation of rhg annotate was slower on some files than Python. This was because Python used the "Medium" profile by default (enabling the revlog chunk cache), while Rust used the "Default" profile (disabling the revlog chunk cache).
-
Mitchell Kember authored
This makes hg-core read resource profile configs from usage.resources. Before, it correctly used that for sub-values such as usage.resources.memory, but for the generic value it incorrectly used usage.resource (singular).
-
- Nov 04, 2024
-
-
Raphaël Gomès authored
It makes sense to keep our doc build happy, even if it is lacking.
-
- Oct 01, 2024
-
-
Raphaël Gomès authored
I suspect this will not be the last time we need to do something like this.
-
- Jun 19, 2024
-
-
Raphaël Gomès authored
These will be needed for future patches of this series to interpret more complex/different config values.
-
- 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.
-
- Aug 09, 2023
-
-
Raphaël Gomès authored
As explained in the previous changeset: Probably being too trigger happy about boolean values, I incorrectly set the transform for a `None` to a `Some(false)`. It would cause for example the `ui.formatted` value to be set to `Some(false)`, which turns off the colors among other things, when `None` would trigger the automatic behavior.
-
Raphaël Gomès authored
Probably being too trigger happy about boolean values, I incorrectly set the transform for a `None` to a `Some(false)`. It would cause for example the `ui.formatted` value to be set to `Some(false)`, which turns off the colors among other things, when `None` would trigger the automatic behavior. This is fixed in the next commit.
-
Raphaël Gomès authored
When a config item's default is a string, it sometimes needs to be parsed into another type, like in the case of `cmdserver.max-log-size`, that returns a number of bytes from a human-readable amount like `25MB`. The logic for the fix is explained inline.
-
- Aug 08, 2023
-
-
Raphaël Gomès authored
The default value (when the user hasn't configured anything) is not run through the value parser, causing a programming error to happen because of type mismatch. This will be fixed in the next commit.
-
- Jul 12, 2023
-
-
Raphaël Gomès authored
The signature is quite heavy, a docstring to explain the idea doesn't hurt.
-
- Jul 06, 2023
-
-
Raphaël Gomès authored
This mirrors the Python implementation now that we're done catching up.
-
- Jul 05, 2023
-
-
Raphaël Gomès authored
In order for the Rust code to gain access to default values of in-core extensions that have a Rust implementation, we need to centralize them alongside the core items declarations. This is the first and so far only one of the extensions that have gained Rust support, I don't think it's worth the churn to move the rest of the extension's configitems yet.
-
- Feb 13, 2023
-
-
Raphaël Gomès authored
This is useful in cases where we access config items that are more... lenient with their types than a fresh new system would allow. For now there is only a single use of this, but we might get more later.
-
- Jul 06, 2023
-
-
Raphaël Gomès authored
Now that configitems.toml exists, we can read from it the default values for all core config items. We will add the devel-warning for use of undeclared config items in a later patch when we're done adding the missing entries for `rhg`.
-
- Feb 27, 2023
-
-
Arseniy Alekseyev authored
clippy emits a warning that all the Result types are way too large because of HgError includes ConfigValueParseError as one of the variants, so its size is 136 bytes. By boxing ConfigValueParseError we're hopefully making everything faster "for free".
-
- Jan 12, 2023
-
-
Raphaël Gomès authored
Just a little cleanup of a TODO found along the way.
-
- Jan 10, 2023
-
-
Raphaël Gomès authored
Module inception is confusing when looking for code and almost never the right choice.
-
- Jan 09, 2023
-
-
Raphaël Gomès authored
All of these are simple changes that for the most part are clear improvements and the rest are at most equivalent. The remaining warnings have to be fixed either with a bigger refactor like for the nested "revlog" module, or in the dependency `bytes-cast`, which we own. This will be done sometime in the future.
-
- Nov 14, 2022
-
-
Raphaël Gomès authored
-
- Sep 20, 2022
-
-
Arseniy Alekseyev authored
-
- Sep 22, 2022
-
-
Arseniy Alekseyev authored
-
- Sep 20, 2022
-
-
Arseniy Alekseyev authored
-
- Jul 19, 2022
-
-
Raphaël Gomès authored
This will be used by the narrow support code in the next commit.
-
- Feb 10, 2022
-
-
Simon Sapin authored
The full test suite now passes with `hg` pointing to rhg. Differential Revision: https://phab.mercurial-scm.org/D12162
-
Simon Sapin authored
The same "label" system is used as in Python code Differential Revision: https://phab.mercurial-scm.org/D12167
-
Simon Sapin authored
Differential Revision: https://phab.mercurial-scm.org/D12166
-
Simon Sapin authored
When a Ui object is needed to print errors about configuration-loading errors, an empty (default) configuration is used. Differential Revision: https://phab.mercurial-scm.org/D12164
-
- Dec 10, 2021
-
-
Simon Sapin authored
This fixes some but not all failures in `tests/test-hgignore.t` when running with `rhg status` enabled. Differential Revision: https://phab.mercurial-scm.org/D11907
-
- Nov 26, 2021
-
-
Raphaël Gomès authored
This will be used in the next patch Differential Revision: https://phab.mercurial-scm.org/D11812
-
- Nov 09, 2021
-
-
Simon Sapin authored
Differential Revision: https://phab.mercurial-scm.org/D11761
-
Simon Sapin authored
This subcommand is disabled by default because of bugs that make some test fail. Enable it in the rest of the tests in order to avoid regressing them. As with `RHG_ON_UNSUPPORTED`, an environment variable is used instead of a configuration file and `HGRCPATH` because some tests override `HGRCPATH`. Running `unset RHG_STATUS` at the start of a test restores the default of `rhg status` being disabled. Hopefully it can be increasingly removed from test files as bugs are fixed. Differential Revision: https://phab.mercurial-scm.org/D11756
-
- Sep 03, 2021
-
-
Simon Sapin authored
This includes the ability to have an extension name/path that contains a comma, by double-quoting it. Differential Revision: https://phab.mercurial-scm.org/D11390
-
- Feb 17, 2021
-
-
Simon Sapin authored
This new method is not used yet outside of its own unit tests, so this changeset should make no observable change. The Rust parser implementation attempts to exactly replicate the behavior of the Python one, even in edge cases where that behavior is… surprising. New unit tests capture some of these edge cases. This started as a line-by-line port. The main changes are: * Pass around a parser mode enum instead of parser functions * Inline the whole parser into one function * Use `[u8]::get` which returns an `Option`, instead of indexing after explicitly checking the length. Differential Revision: https://phab.mercurial-scm.org/D11389
-
- Jun 07, 2021
-
-
Pulkit Goyal authored
My previous attempts to have rhg end with correct exit code was more of bug hunting. I found cases which were failing and fixed them. But as one might expect, more tests started failing. Let's add exit code `HgError::Abort()` and make it users explicitly tell what exit code they want. Differential Revision: https://phab.mercurial-scm.org/D10838
-
Pulkit Goyal authored
This will help us in better handling of error caused when trying to load `--config` values. Differential Revision: https://phab.mercurial-scm.org/D10837
-
- Apr 15, 2021
-
-
Pierre-Yves David authored
We move the function in a lower level module to avoid cycle. It moves next to `parsebool` who had to migrate for the same reasons. Differential Revision: https://phab.mercurial-scm.org/D10449
-
- Mar 19, 2021
-
-
Simon Sapin authored
This allows using the `?` operator in more places, as the next commit does. Differential Revision: https://phab.mercurial-scm.org/D10238
-