Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 24 Jul 2023 05:13:52 +0200] rev 50810
transaction: actually delete file created during the transaction on rollback
Transaction currently has two modes:
- one where file created during the transaction are deleted on rollback,
- one where file created during the transaction are truncated to 0 on rollback.
Before this change, `hg rollback` and `hg recover` are using the "delete" mode
and transaction abort is using the "truncate" option. This difference is never
really explained. A long time ago, there was two code paths, with this
divergence existing for unclear reasons. When the two code paths got merged into
a single one, a boolean argument have been added to preserve this divergence,
mostly probably as a cargo cult.
The divergence is weird and induce bad surprises, and the truncate behavior is a
bit odds, introducing other bad surprises (e.g.
08ecbdba186f)
So solve this, we stop using the "truncate" behavior and unify on the "delete"
behavior. Despite being currently more "common", the truncate behavior seems
less natural, resulting in the transaction leaving empty file around.
This is landed on default, early in the cycle, to help us catch problems that
could emerge.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 28 Jul 2023 17:08:37 +0100] rev 50809
rhg: tweak rhg fallback code structure
The goal here is to share the code that accesses the config setting,
but also move it to the top-level, so that we can more easily change
this code later.
(in fact in Jane Street we want to make it choose chg in some cases)
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 21 Jul 2023 15:26:15 +0200] rev 50808
journal: track bookmark deletion
Bookmark deletion are now properly tracked by the journal extensions.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 21 Jul 2023 15:28:52 +0200] rev 50807
journal: show that we do not track deletion
This was an oversight for the initial implementation.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 21 Jul 2023 09:22:18 -0700] rev 50806
contrib: upgrade merge-lists from clap v3 to clap v4
Mostly to avoid having clap v3 in our dependencies, due to
https://osv.dev/vulnerability/GHSA-g98v-hv3f-hcfr (even though that seems pretty
harmless).
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 Jul 2023 21:45:39 +0200] rev 50805
compat: use cp -R in `test-revlog-delta-find.t` (
issue6835)
This follow POSIX and make things compatible with NetBSD.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 Jul 2023 17:42:33 +0200] rev 50804
compat: use cp -R in `test-bundle-phase-internal.t` (
issue6835)
This follow POSIX and make things compatible with NetBSD.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 21 Jul 2023 03:56:28 +0200] rev 50803
infinitepush: drop the extension
The writing have been on the wall for a long time.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Jun 2023 13:27:09 +0200] rev 50802
perf: display all timing by default
This is much more useful and end up enable it everywhere.
I don't think we have strong backward compatibility guarantee for perf.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 10:53:12 +0200] rev 50801
wrapfunction: deprecated calling "wrapfunction" with bytes
This will help us to detect and eradicates legacy calls. This is on the path to
deprecating `util.safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 15:39:19 +0200] rev 50800
wrapfunction: deprecates calling `wrappedfunction` with bytes
This will help us to detect and eradicates legacy calls.
This is on the path to deprecating `util.safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 19:34:04 +0200] rev 50799
wrapfunction: use sysstr instead of bytes as argument in various tests
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 19:33:14 +0200] rev 50798
wrapfunction: use sysstr instead of bytes as argument in "exthelper"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 15:38:53 +0200] rev 50797
wrapfunction: use sysstr instead of bytes as argument in "sqlitestore"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 19:32:17 +0200] rev 50796
wrapfunction: use sysstr instead of bytes as argument in "share"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 19:31:26 +0200] rev 50795
wrapfunction: use sysstr instead of bytes as argument in "perf"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:30:44 +0100] rev 50794
wrapfunction: use sysstr instead of bytes as argument in "zeroconf"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:27:17 +0100] rev 50793
wrapfunction: use sysstr instead of bytes as argument in "sqlitestore"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:26:18 +0100] rev 50792
wrapfunction: use sysstr instead of bytes as argument in "sparse"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:25:57 +0100] rev 50791
wrapfunction: use sysstr instead of bytes as argument in "schemes"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:25:43 +0100] rev 50790
wrapfunction: use sysstr instead of bytes as argument in "remotenames"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:25:07 +0100] rev 50789
wrapfunction: use sysstr instead of bytes as argument in "remotefilelog"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:24:53 +0100] rev 50788
wrapfunction: use sysstr instead of bytes as argument in "pager"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:24:40 +0100] rev 50787
wrapfunction: use sysstr instead of bytes as argument in "narrow"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:23:12 +0100] rev 50786
wrapfunction: use sysstr instead of bytes as argument in "lfs"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:22:41 +0100] rev 50785
wrapfunction: use sysstr instead of bytes as argument in "largefiles"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:22:28 +0100] rev 50784
wrapfunction: use sysstr instead of bytes as argument in "keyword"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:22:15 +0100] rev 50783
wrapfunction: use sysstr instead of bytes as argument in "journal"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:21:55 +0100] rev 50782
wrapfunction: use sysstr instead of bytes as argument in "infinitepush"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:21:32 +0100] rev 50781
wrapfunction: use sysstr instead of bytes as argument in "histedit"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:20:58 +0100] rev 50780
wrapfunction: use sysstr instead of bytes as argument in "highlight"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 16:47:25 +0200] rev 50779
wrapfunction: use sysstr instead of bytes as argument in the "git" extension
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:19:06 +0100] rev 50778
wrapfunction: use sysstr instead of bytes as argument in "fsmonitor"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 16:12:33 +0200] rev 50777
wrapfunction: use sysstr instead of bytes as argument in "fastannotate"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:10:22 +0100] rev 50776
wrapfunction: use sysstr instead of bytes as argument in "clonebundles"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:10:00 +0100] rev 50775
wrapfunction: use sysstr instead of bytes as argument in "bookflow"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 03 Feb 2023 04:09:49 +0100] rev 50774
wrapfunction: use sysstr instead of bytes as argument in "beautifygraph"
This is as valid and simpler, it will help us to eventually get ride of
`safehasattr`.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 10 Jul 2023 15:59:04 +0200] rev 50773
byteify-strings: passe sysstr to attr function and wrapper
These function now accepts string so we should not do byteify them anymore.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 12 Jul 2023 12:47:08 +0200] rev 50772
repoview: fix the filter created by `extrafilter`
The `name` variable was updated in each interaction of the loop, making all new
filters inheriting from the same base (the last one iterated), leading to
terrible terrible misbehavior.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 12 Jul 2023 12:46:58 +0200] rev 50771
repoview: show `extrafilter` misbehave when other filtering is in play
See new changeset for fix and details.
Raphaël Gomès <rgomes@octobus.net> [Wed, 12 Jul 2023 10:59:19 +0200] rev 50770
rust-config: add docstring to inner `get_parse` method
The signature is quite heavy, a docstring to explain the idea doesn't hurt.
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 11:44:30 +0200] rev 50769
rust-config: add devel warning when using undeclared config items
This mirrors the Python implementation now that we're done catching up.
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 12:17:20 +0200] rev 50768
rhg: use default configitem in `cat`
Now that we've declared the items, we can get rid of the manual fallback.
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 11:47:41 +0200] rev 50767
rhg: add config defaults to configitems.toml
This will allow us to use the same default config mechanic as the rest of the
code.
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 11:17:55 +0200] rev 50766
rust-blackbox: use `is_extension_enabled` config helper
It's there, may as well use it to make the code clearer and less bug-prone.
Raphaël Gomès <rgomes@octobus.net> [Wed, 05 Jul 2023 23:59:22 +0200] rev 50765
configitems: move blackbox's config items to the new configitems.toml
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.
Raphaël Gomès <rgomes@octobus.net> [Mon, 13 Feb 2023 18:11:48 +0100] rev 50764
rust-config: add config getters that don't fall back to defaults
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.
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 14:32:07 +0200] rev 50763
rust-config: add support for default config items
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`.
Raphaël Gomès <rgomes@octobus.net> [Mon, 23 Jan 2023 18:08:11 +0100] rev 50762
configitems: declare items in a TOML file
Mercurial ships with Rust code that also needs to read from the config.
Having a way of presenting `configitems` to both Python and Rust is needed
to prevent duplication, drift, and have the appropriate devel warnings.
Abstracting away from Python means choosing a config format. No single format
is perfect, and I have yet to come across a developer that doesn't hate all of
them in some way.
Since we have a strict no-dependencies policy for Mercurial, we either need
to use whatever comes with Python, vendor a library, or implement a custom
format ourselves.
Python stdlib means using JSON, which doesn't support comments and isn't great
for humans, or `configparser` which is an obscure, untyped format that nobody
uses and doesn't have a commonplace Rust parser.
Implementing a custom format is error-prone, tedious and subject to the
same issues as picking an existing format.
Vendoring opens us to the vast array of common config formats. The ones
being picked for most modern software are YAML and TOML. YAML is older and
common in the Python community, but TOML is much simpler and less error-prone.
I would much rather be responsible for the <1000 lines of `tomli`, on top of
TOML being the choice of the Rust community, with robust crates for reading it.
The structure of `configitems.toml` is explained inline.
Raphaël Gomès <rgomes@octobus.net> [Mon, 23 Jan 2023 17:11:42 +0100] rev 50761
thirdparty: vendor tomli
The next commit will introduce a .toml file to abstract configitems
away from Python. Python 3.11 has a toml read-only library (`tomllib`), which
gives us a way out of vendoring eventually.
For now, we vendor the backport, specifically version 1.2.3 which is still
compatible with Python 3.6.
Raphaël Gomès <rgomes@octobus.net> [Mon, 23 Jan 2023 18:52:05 +0100] rev 50760
configitems: add `documentation` field
It may be useful to expose documentation information in the help in some form.
This will be populated in a future changeset by using the current comments
that are relevant for users.
Raphaël Gomès <rgomes@octobus.net> [Mon, 23 Jan 2023 17:21:14 +0100] rev 50759
configitems: use standard "dynamicdefault" approach in edge case
This makes for fewer edge cases, which will help a future patch.
Raphaël Gomès <rgomes@octobus.net> [Tue, 17 Jan 2023 14:53:18 +0100] rev 50758
configitems: fix typo in devel warning about extension overrides
Mads Kiilerich <mads@kiilerich.com> [Wed, 28 Jun 2023 14:23:13 +0200] rev 50757
extensions: imp module is removed in Python 3.12 - use importlib to load files
imp has been deprecated for a long time, and has finally been removed in Python
3.12 .
imp was only used for loading extensions that has been specified with direct
.py path or path to a package directory. The same use cases can be achieved
quite simple with importlib, , possiby with small changes in corner cases with
undefined behaviour, such as extensions without .py source.
There might also be corner cases and undefined behaviour around use of
sys.modules and reloading.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 13:05:03 +0200] rev 50756
utils: imp module is removed in Python 3.12 - get is_frozen() from _imp
imp has been deprecated for a long time, and has finally been removed in Python
3.12 .
The successor importlib is using the same internal _imp module as imp, but
doesn't expose it's is_frozen. Using the internal function directly seems like
the cleanest solution.
Another alternative to
imp.is_frozen("__main__")
is
sys.modules['__main__'].__spec__.origin == 'frozen'
but that seems even more internal and fragile.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 22:31:44 +0200] rev 50755
extensions: address ast deprecations introduced in Python 3.12
Tests would fail with:
.../mercurial/extensions.py:910: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
if isinstance(a, ast.Str):
.../mercurial/extensions.py:912: DeprecationWarning: ast.Bytes is deprecated and will be removed in Python 3.14; use ast.Constant instead
elif isinstance(a, ast.Bytes):
.../mercurial/extensions.py:913: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead
name = a.s
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 08:39:12 +0200] rev 50754
vfs: handle shutil.rmtree deprecation of onerror in Python 3.12
Tests would fail with warnings:
.../mercurial/vfs.py:289: DeprecationWarning: onerror argument is deprecated, use onexc instead
The excinfo changed slightly, but we don't use it anyway.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 10:09:11 +0200] rev 50753
tests: fix sortdict doctest with Python 3.12
The output of OrderedDict changed to use plain dict syntax:
$ python3.11 -c "import collections;print(collections.OrderedDict([('a', 0), ('b', 1)]))"
OrderedDict([('a', 0), ('b', 1)])
$ python3.12 -c "import collections;print(collections.OrderedDict([('a', 0), ('b', 1)]))"
OrderedDict({'a': 0, 'b': 1})
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 13:51:50 +0200] rev 50752
utils: stop using datetime.utcfromtimestamp() deprecated in Python 3.12
Python3.12 made tests fail with warnings:
DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).
Computing the diff while in timestamp seconds seems to preserve to the original
intent from
ae04af1ce78d.
It would be nice to have some doctest coverage of this, with the problematic
corner cases that has popped up over time...
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 16:07:34 +0200] rev 50751
branching: merge stable into default