Simon Sapin <simon.sapin@octobus.net> [Wed, 17 Feb 2021 13:00:25 +0100] rev 46600
blackbox: Remove misleading quotes in config example
This example previously looked like quotes were part of configuration file
syntax, and the parsed `date-format` value was the part inside of them.
This is not the case: config syntax only parses quotes in list values.
Instead using that config would result in literal quotes being written to
`.hg/blackbox.log` as part of the date format.
This changes the example to what was probably intended.
Differential Revision: https://phab.mercurial-scm.org/D10011
Simon Sapin <simon.sapin@octobus.net> [Thu, 11 Feb 2021 15:51:11 +0100] rev 46599
rust: Add a log file rotation utility
This is ported to Rust from `mercurial/loggingutil.py`.
The "builder" pattern is used to make it visible at call sites what the two
numeric parameters mean. In Python they might simply by keyword arguments.
Differential Revision: https://phab.mercurial-scm.org/D10010
Simon Sapin <simon.sapin@octobus.net> [Tue, 16 Feb 2021 15:22:20 +0100] rev 46598
rust: Add a `ConfigValueParseError` variant to common errors
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