- 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 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).
-
- 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.
-
- Sep 22, 2022
-
-
Arseniy Alekseyev authored
-
- Sep 20, 2022
-
-
Arseniy Alekseyev authored
-
- Feb 10, 2022
-
-
Simon Sapin authored
The same "label" system is used as in Python code Differential Revision: https://phab.mercurial-scm.org/D12167
-
- Apr 10, 2021
-
-
Pulkit Goyal authored
hg parses `-R` and `--repository` CLI arguments "early" in order to know which local repository to load config from. (Config can then affect whether or how to fall back.) The value of of those arguments can be not only a filesystem path, but also an alias configured in the `[paths]` section. This part was missing in rhg and this patch implements that. The current patch still lacks functionality to read config of current repository if we are not at root of repo. That will be fixed in upcoming patches. A new crate `home` is added to get path of home directory. Differential Revision: https://phab.mercurial-scm.org/D10296
-
- Feb 17, 2021
-
-
Simon Sapin authored
Differential Revision: https://phab.mercurial-scm.org/D10021
-
- Feb 16, 2021
-
-
Simon Sapin authored
Configuration files are parsed into sections of key/value pairs when they are read, but at that point values are still arbitrary bytes. Only when a value is accessed by various parts of the code do we know its expected type and syntax, so values are parsed at that point. Let’s make a new error type for this latter kind of parsing error, and add a variant to the common `HgError` so that most code can propagate it without much boilerplate. Differential Revision: https://phab.mercurial-scm.org/D10009
-
- Feb 04, 2021
-
-
Simon Sapin authored
CLI `--config` argument parsing is still missing, as is per-repo config Differential Revision: https://phab.mercurial-scm.org/D9961
-
- Dec 29, 2020
-
-
Raphaël Gomès authored
The config module exposes a `Config` struct, unused for now. It only reads the config file local to the repository, but handles all valid patterns and includes/unsets. It is structured in layers instead of erasing by reverse order of precedence, allowing us to transparently know more about the config for debugging purposes, and potentially other things I haven't thought about yet. This change also introduces `format_bytes!` to `hg-core`. Differential Revision: https://phab.mercurial-scm.org/D9408
-