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
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 16:04:36 +0200] rev 50750
Added signature for changeset
3ffc7209bbae
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 16:04:18 +0200] rev 50749
Added tag 6.5 for changeset
3ffc7209bbae
Raphaël Gomès <rgomes@octobus.net> [Thu, 06 Jul 2023 16:02:59 +0200] rev 50748
relnotes: add 6.5 final
Georges Racinet <georges.racinet@octobus.net> [Thu, 06 Jul 2023 11:58:24 +0200] rev 50747
rust-changelog: removed now useless early conditional for NULL_REVISION
Now that the underlying `RevlogEntry` returned for `NULL_REVISION` is
viable, it has become pointless to check NULL_REVISION several times,
even for performance: the check will be far more frequent than the benefit
of bailing earlier in the rare case where the requested revision is
`NULL_REVISION`.
This case is covered explicitly by the first assertion of
`test_data_from_rev_null`.
Georges Racinet <georges.racinet@octobus.net> [Thu, 06 Jul 2023 11:53:40 +0200] rev 50746
rust-revlog: fix RevlogEntry.data() for NULL_REVISION
Before this change, the pseudo-entry returned by `Revlog.get_entry` for
`NULL_REVISION` would trigger errors in application code using it.
For example, this fixes a crash spotted with changelog data
while implementing RHGitaly: `Changelog.data_for_rev(-1)` was already
returning the pseudo content as expected, e.g., for `hg log`, but
`Changelog.entry_for_rev(-1).data()` would still crash with
"corrupted revlog, hash check failed for revision -1". There is
an added test for this scenario.
Georges Racinet <georges.racinet@octobus.net> [Thu, 06 Jul 2023 11:43:26 +0200] rev 50745
rust-revlog: using constant in test
Always better
Georges Racinet <georges.racinet@octobus.net> [Thu, 30 Mar 2023 11:34:30 +0200] rev 50744
rust-revlog: fix incorrect results with NULL_NODE prefixes
In case a short hash is a prefix of `NULL_NODE`, the correct revision
number lookup is `NULL_REVISION` only if there is no match in the nodemap.
Indeed, if there is a single nodemap match, then it is an ambiguity with the
always matching `NULL_NODE`.
Before this change, using the Mercurial development repository as a testbed (it
has public changesets with node ID starting with `0005` and `0009`), this is
what `rhg` did (plain `hg` provided for reference)
```
$ rust/target/debug/rhg cat -r 000 README
README: no such file in rev
000000000000
$ hg cat -r 000 README
abort: ambiguous revision identifier: 000
```
Here is the expected output for `rhg` on ambiguous prefixes (again, before
this change):
```
$ rust/target/debug/rhg cat -r 0001 README
abort: ambiguous revision identifier: 0001
```
The test provided by
8c29af0f6d6e in `test-rhg.t` could become flaky with
this change, unless all hashes are fixed. We expect reviewers to be more
sure about that than we are.
Georges Racinet <georges.racinet@octobus.net> [Thu, 30 Mar 2023 10:29:29 +0200] rev 50743
rust-revlog: split out method for `rev_from_node` without persistent nodemap
This will make easier for the bug fix that is about to come.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 08 Jun 2023 00:03:54 -0400] rev 50742
win32mbcs: unbyteify some strings for py3 support
A crash was reported on the TortoiseHg bug tracker for this[1].
[1] https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5905
Raphaël Gomès <rgomes@octobus.net> [Tue, 04 Jul 2023 12:30:31 +0200] rev 50741
heptapod-ci: turn off pipelines for merge request events
These are always duplicated by the external (from the user) push, or internal
(from Heptapod itself) push pipeline, so they're entirely redundant.
Raphaël Gomès <rgomes@octobus.net> [Tue, 04 Jul 2023 12:23:05 +0200] rev 50740
heptapod-ci: always make the default run condition explicit
This has no effect on behavior, it's just to make everything obvious.
Raphaël Gomès <rgomes@octobus.net> [Tue, 04 Jul 2023 12:21:45 +0200] rev 50739
heptapod-ci: remove push exception for named branches
The internal workings of Heptapod cause even fast-forward merges to look like
pushes to Gitlab. The only way to run a pipeline on topic-less named branches
is not through the web interface. I am probably the only person affected by
this, so it's not really a problem.
This was confirmed with Georges, the maintainer of Heptapod, though the only
way to be *actually* sure, is to merge this and see.
Raphaël Gomès <rgomes@octobus.net> [Mon, 03 Jul 2023 15:28:17 +0200] rev 50738
heptapod-ci: (hopefully) fix the pipeline savings system
There is no easy way for me to test this outside of the actual repo since
it would require setting up `heptapod-runner` locally, making a Git repo
with the right changes, etc. It's not worth my time at this point.
If this fails, I'll try to ask for help from Georges, the maintainer
of Heptapod.
Raphaël Gomès <rgomes@octobus.net> [Mon, 03 Jul 2023 11:02:36 +0200] rev 50737
heptapod-ci: don't run pipelines for topic-less branches
See inline comment for more details.
Mathias De Mare <mathias.de_mare@nokia.com> [Tue, 27 Jun 2023 16:19:42 +0200] rev 50736
clonebundles: add warning if auto-generate is enabled without formats
Mathias De Mare <mathias.de_mare@nokia.com> [Tue, 27 Jun 2023 15:34:24 +0200] rev 50735
clonebundles: fix display of auto-generate.on-change lines
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 18:00:28 +0200] rev 50734
hgweb: drop references to deprecated cgitb
cgitb is going away and gives warnings when importing, and that make tests
fail:
$TESTTMP/hgweb.cgi:5: DeprecationWarning: 'cgitb' is deprecated and slated for removal in Python 3.13
The lack of a "nice" high level error handler is not a huge problem, neither
for users (where it is disabled anyway) or for tests (where we don't use a
browser and the plain tracebacks often are more readable). It is inevitable
that it is going away, and there is no obvious alternative. Remove it and move
on.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 12:09:17 +0200] rev 50733
setup: fall back to setuptools setup if distutils isn't available
The setuptools comments around this seems slightly outdated. Setuptools is
improving and distutils is being deprecated, so it should perhaps be the
default. But at least, it is a fair fallback.
Mads Kiilerich <mads@kiilerich.com> [Thu, 23 Mar 2023 16:45:12 +0100] rev 50732
tests: use simple mock smtp server instead of deprecated asyncore smtpd
test-patchbomb-tls.t would fail with:
.../hg/tests/dummysmtpd.py:6: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
import asyncore
.../hg/tests/dummysmtpd.py:8: DeprecationWarning: The smtpd module is deprecated and unmaintained and will be removed in Python 3.12. Please see aiosmtpd (https://aiosmtpd.readthedocs.io/) for the recommended replacement.
import smtpd
The recommended migration path to the standalone asiosmtpd would be overkill.
The tests do not need a full smtp server - we can just use a very simple mock
hack to preserve the existing test coverage.
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 16:45:13 +0200] rev 50731
tests: fix dummysmtpd argument check
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 15:51:39 +0200] rev 50730
tests: improve test-patchbomb-tls.t by by logging errors and data
The actual SSL error might be like:
::1 ssl error: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1002)
and will probably vary so much that it can't be checked in the test. It is
however very useful when debugging failures.
Mads Kiilerich <mads@kiilerich.com> [Thu, 23 Mar 2023 16:48:44 +0100] rev 50729
tests: show test-patchbomb-tls.t smtp server log
Improve test coverage by exposing what the smtp server actually receives.
Make dummystmtpd redirect stderr to a log file.
Mads Kiilerich <mads@kiilerich.com> [Wed, 28 Jun 2023 01:31:10 +0200] rev 50728
demandimport: don't delay _distutils_hack import
test-demandimport.py would fail on 'import distutils.msvc9compiler' because
warnings:
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Telling demandimport to ignore this module will allow the hack to work as
intended.
Note:
The test for distutils.msvc9compiler comes from
2205d00b6d2b. But since then,
distutils is going away, and setuptools has moved forward and is replacing it.
It is unclear exactly what is being tested here and how setuptools should
depended on msvc9compiler. The test might no longer be relevant.
Mads Kiilerich <mads@kiilerich.com> [Wed, 22 Mar 2023 16:05:59 +0100] rev 50727
tests: update test-remotefilelog-gc.t for Python 3.11
The test output changed because test coverage changed because normpath changed:
$ python3.10 -c 'import os; print(repr(os.path.normpath("asdas\0das")))'
'asdas\x00das'
$ python3.11 -c 'import os; print(repr(os.path.normpath("asdas\0das")))'
'asdas'
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 14:54:00 +0200] rev 50726
tests: use grep -F instead of obsolescent fgrep
Testing on Fedora 38 failed with:
fgrep: warning: fgrep is obsolescent; using grep -F
The warning comes from
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=
a9515624709865d480e3142fd959bccd1c9372d1
. For further anecdotal evidence of the change, see
https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep .
grep -F is POSIX, but there is a risk that it doesn't work the same on all
platforms - especially older Unix versions. It should however always be
possible to put a GNU grep in $PATH before running the tests.
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 14:34:58 +0200] rev 50725
tests: use grep -E instead of obsolescent egrep
Testing on Fedora 38 failed with:
egrep: warning: egrep is obsolescent; using grep -E
The warning comes from
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=
a9515624709865d480e3142fd959bccd1c9372d1
. For further anecdotal evidence of the change, see
https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep .
This reverses the code check that goes back to
e7d3b509af8b. grep -E is POSIX,
but there is a risk that it doesn't work the same on all platforms - especially
older Unix versions. It should however always be possible to put a GNU grep in
$PATH before running the tests.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 26 Jun 2023 11:15:30 +0100] rev 50724
dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Before this MR running `hg debugrebuilddirstate` simply grows the dirstate
without bound, never shrinking it, because the unused bytes counter stays low,
even though the entirety of the file becomes unused.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 26 Jun 2023 11:21:43 +0100] rev 50723
dirstate-v2: actually fix the dirstate-v2 upgrade race
It looks like the previous fix for the dirstate-v2 upgrade race didn't work.
The problem is that it only recovers in case the size of the v1 `dirstate` file
is smaller than the `v2` one, whereas in real life it's always larger.
This commit changes the test to be more realistic, which reveals the crash,
and changes the code to fix the crash.
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 14:24:45 +0200] rev 50722
Added signature for changeset
bb42988c7e15
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 14:24:21 +0200] rev 50721
Added tag 6.5rc0 for changeset
bb42988c7e15
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 12:36:49 +0200] rev 50720
relnotes: add 6.5rc0
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 11:36:37 +0200] rev 50719
branching: merge default into stable for 6.5rc0
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 11:28:17 +0200] rev 50718
branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 11:18:47 +0200] rev 50717
Added signature for changeset
271a4ab29605
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 11:18:27 +0200] rev 50716
Added tag 6.4.5 for changeset
271a4ab29605
Raphaël Gomès <rgomes@octobus.net> [Thu, 22 Jun 2023 11:17:40 +0200] rev 50715
relnotes: add 6.4.5
Jason R. Coombs <jaraco@jaraco.com> [Wed, 21 Jun 2023 14:00:50 -0400] rev 50714
narrow: indicated the default of 'Yes' when confirming auto-remove-includes
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Jun 2023 15:55:07 +0200] rev 50713
clone-bundles: check we generate a valid specification
The short bundle-spec are ambiguous and should be expanded to a full one before
clone bundle can use it. We fix the issue and add a test actually using the
generated manifest for a clone bundle operation.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Jun 2023 15:53:33 +0200] rev 50712
bundle-spec: add an official method to format a spec into a string
This will be useful for automatic-clonebundles.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Jun 2023 18:15:35 +0200] rev 50711
clonebundles: adds a auto-generate.serve-inline option
This new option disable the "external" serving of auto generated bundle in favor
of using the new "inline bundle" feature that allow serving such bundle through
the mercurial protocol.
This is a less efficient, but very easy to setup way to start using clone bundle.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Jun 2023 18:15:27 +0200] rev 50710
clone-bundle: only add the REQUIRESNI bit for http(s)
we don't needs it for `peer-bundle-cache://` for example
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 23 May 2023 10:24:57 +0200] rev 50709
stream-clone: add a stream-v3 variant of test-persistent-nodemap.t
This will be useful to track and validate future changes to the stream-v3
protocol.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 23 May 2023 10:18:01 +0200] rev 50708
stream-clone: split the stream part out of test-persistent-nodemap.t
We want to test multiple variants, so let's make it an independent test.
Small adaptations and simplifications are needed in the test output as the
tested repository is now shorter.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 23 May 2023 03:09:46 +0200] rev 50707
stream-clone: explicitly split debug test output for application per version
Altering the format may introduce significant changes in output and in order.
It is going to be simpler to deal with explicitly different blocks for the
output.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Jun 2023 17:39:22 +0100] rev 50706
stream-clone: add a v3 version of the protocol
This new version is less rigid regarding the extract number of files and number
of bytes to be actually transfered, it also lays the groundwork for other
improvements.
The format stays experimental, but this is an interesting base to build upon.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Jun 2023 18:20:28 +0100] rev 50705
stream-clone: fix the help for an argument of perf::stream-locked-section
The help for `--stream-version` had a typo and missed a value.
pierre-yves.david@ens-lyon.org [Tue, 20 Jun 2023 02:35:30 +0200] rev 50704
infinitepush: aggressively deprecated infinite push
We add a large warning and an explicit abort. Both can be disable through
config, but neither are explicitly documented. If any user exists I really want
them to get in touch with the community.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Jun 2023 16:13:16 +0200] rev 50703
clone-bundle: double check that inline clone bundle does not break local case
Since there is a large NotImplementedError in the code, I prefer we have a
double check here.