Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:47:29 +0200] rev 51764
manifest: type and fix unhexlify
Some part of that function seems to date back from Python 2. It raise question
about whether this function is useful or not, but let us just fix it for now.
This was caught by pytype.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Aug 2024 10:45:31 +0200] rev 51763
docker-pytype: use version v2.1 of the CI image
It use a more recent pytype as far as I understand.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:14:05 +0200] rev 51762
context: some gratuitous documentation improvement
I wrote it as I was reading the code.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 13:07:13 +0100] rev 51761
profiling: add a py-spy profiling backend
The recommended way to use this backend is by setting the config
`profiling.output` to point to a file because py-spy output is not
human-readable.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 11:14:58 +0100] rev 51760
copytracing: fix a bug in an edge case in metadata.compute_all_files_changes
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 13:04:38 +0100] rev 51759
rhg: ignore readonly FS error when saving dirstate
The error is already ignored when the .hg directory is read-only,
so this is only fair. (the python hg is silent on readonly fs, too)
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 01 Aug 2024 13:38:31 +0100] rev 51758
commit: set whole manifest entries at once (node with its associated flags)
Add a new function manifest.set that sets whole manifest entries at once,
so the caller doesn't have to do two separate operations:
m[p] = n
m.set_flags(f)
becomes:
m.set(p, n, f)
This obviously saves an extra lookup by path, and it also lets the
underlying manifest implementation to be more efficient as
it doesn't have to deal with partially-specified entries.
It makes the interaction conceptually simpler, as well, since we don't
have to go through an intermediate state of incorrect
partially-written entry.
(the real motivation for this change is an alternative manifest
implementation where we batch pending writes, and dealing with
fully defined entries makes the batching logic muchsimpler while
avoiding slowdown due to alternating writes and reads)
Matt Harbison <matt_harbison@yahoo.com> [Thu, 01 Aug 2024 11:43:10 -0400] rev 51757
typing: add type hints around the matcher for subrepo archiving
Mostly this is meant to try to smoke out any other potential issues around the
matcher, since these args were mostly previously treated as `Any`, and therefore
checking wasn't done.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 01 Aug 2024 01:52:11 -0400] rev 51756
subrepo: drop the default value of None for the archive matcher
This was flagged by pytype after adding hints to `match.subdirmatcher` that it
takes a non-optional matcher. That matcher argument is used without a guard in
the subdirmatcher constructor, so that's the correct restriction.
I don't think this fixes a bug in practice because the only way these are
invoked is either by a parent `hgsubrepo.archive()`, `archival.archive()`, or
the largefiles override of these. The `hgsubrepo.archive()` case (and the
largefiles override) uses what the caller provided, so the caller will
eventually be `archival.archive()` (or the largfiles override) up the call
chain. The `archival.archive()` method also has None for its matcher's default
arg. However, the three callers of that (`commands.archive()`,
`webcommands.archive()`, and `extdiff.snapshot()`) all provide a matcher
argument, so the None case can never occur unless a 3rd party extension swaps it
for None. Sadly, we can't make the argument on the `archival.archive()`
non-optional because there is a kwarg prior to it.
Even though the largefiles override of `archival.archive()` is provided a valid
matcher, we duplicate the internal creation of the matcher that the original
`archival.archive()` does for consistency. By eliminating an impossible to hit
case, we can simplify some of the subrepo code too, by dropping unreachable
code.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 16:42:38 +0200] rev 51755
branching: merge stable into default
Post 6.8.1 release.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 16:34:37 +0200] rev 51754
Added signature for changeset
11a9e2fc0caf
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 16:34:35 +0200] rev 51753
Added tag 6.8.1 for changeset
11a9e2fc0caf
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 15:38:24 +0200] rev 51752
relnotes: add 6.8.1
Raphaël Gomès <rgomes@octobus.net> [Thu, 01 Aug 2024 14:00:07 +0200] rev 51751
rhg: expand user and environment variables in ignore includes
This was reported by a user, and was a TODO long overdue.
Mads Kiilerich <mads@kiilerich.com> [Tue, 27 Jun 2023 13:05:03 +0200] rev 51750
utils: avoid using internal _imp.is_frozen()
imp has been deprecated for a long time, and were removed in Python 3.12 . As a
workaround, we started using the internal _imp. That is ugly and risky.
It seems less risky to get the functionality in some other way. Here, we just
inspect if 'origin' of the '__main__' module is set and 'frozen'. That seems to
work and do the same, and might be better than using the internal _imp
directly.
This way of inspecting module attributes seems to work in some test cases, but
it is a risky change. This level of importlib doesn't have much documentation,
a complicated implementation, and we are dealing with some odd use cases.
Mads Kiilerich <mads@kiilerich.com> [Mon, 22 Jul 2024 18:20:03 +0200] rev 51749
utils: fix resourceutil use of deprecated importlib.resources
Some importlib functionality was deprecated in 3.11 . The documentation on
https://docs.python.org/3.12/library/importlib.resources.html recommends using
the new .files() API that was introduced in 3.9.
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 20:32:07 +0100] rev 51748
cext: use sys.executable instead of deprecated Py_GetProgramFullPath
Fix warning with Python 3.13:
mercurial/cext/parsers.c: In function 'check_python_version':
mercurial/cext/parsers.c:1243:30: warning: 'Py_GetProgramFullPath' is deprecated [-Wdeprecated-declarations]
1243 | Py_GetProgramFullPath());
| ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.13/Python.h:119,
from mercurial/cext/parsers.c:11:
/usr/include/python3.13/pylifecycle.h:43:43: note: declared here
43 | Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
| ^~~~~~~~~~~~~~~~~~~~~
At this point in time, the PyConfig struct memory has been released and the PyConfig API can't be used.
https://docs.python.org/3.13/c-api/init.html#c.Py_GetProgramFullPath recommands
using sys.executable instead. Let's assume that will work in all versions.
It would perhaps be better to use PySys_GetObject, but I prefer to stay
consistent with how the same function is retrieving sys.hexversion.
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 51747
subrepoutil: pass re.sub 'count' argument by name
Python 3.13 started warning:
DeprecationWarning: 'count' is passed as positional argument
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 51746
tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position
This bug was caught by the new Python 3.13 warning:
DeprecationWarning: 'count' is passed as positional argument
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 21:31:41 +0200] rev 51745
tests: use packaging from setuptools instead of deprecated distutils
When invoking StrictVersion in 3.12 we got:
DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
distutils is dead in the standard library, and we have to move towards using
`setuptools` as general extern dependency. Instead of also requiring the extern
`packaging`, we will just use the packaging that is vendored in setuptools.
Mads Kiilerich <mads@kiilerich.com> [Mon, 26 Jun 2023 15:16:51 +0200] rev 51744
tests: drop test-demandimport.py distutils test that failed with warnings
The test would fail 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.")
The test for distutils.msvc9compiler comes from
2205d00b6d2b. But since then,
distutils is going away, and this test must change somehow. It is unclear exactly
how setuptools depended on msvc9compiler, but setuptools also moved forward,
and this exact test no longer seems relevant. It thus seems like a fair
solution to remove the test while keeping the demandimport blacklist of
distutils.msvc9compiler.
Mads Kiilerich <mads@kiilerich.com> [Thu, 29 Jun 2023 20:02:27 +0200] rev 51743
utils: test coverage of makedate
Explore the scenario from
ae04af1ce78d to avoid future regressions.
This was intended to give some coverage of the change in
faccec1edc2c.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 09 Jul 2024 20:08:48 +0200] rev 51742
mmap: populate mapping in a background thread
When possible, we populate the memory mapping in a second thread. The mmap
population does not only read the data from disk to memory. It also actually
fill the memory mapping between process memory address and the physical memory
used by the file system cache containing the mmap'ed data.
Doing so buy back the slowdown from pre-population when it matters. When most
data is accessed, only a few page fault will occurs, while the background thread
fill the memory controller. When few data is accessed, the non-blocking mmap
won't have to wait for all data to be populated.
Here is a few example of improvement seen in benchmark around unbundle and push:
### data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog
# benchmark.name = hg.command.unbundle
# benchmark.variants.
issue6528 = disabled
# benchmark.variants.reuse-external-delta-parent = yes
# benchmark.variants.revs = any-100-extra-rev
before: 0.758101
after: 0.732129 (-3.43%, -0.03)
## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog
before: 1.519941
after: 1.503473 (-1.08%, -0.02)
### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog
# benchmark.name = hg.command.push
# bin-env-vars.hg.flavor = default
# benchmark.variants.
issue6528 = disabled
# benchmark.variants.protocol = ssh
# benchmark.variants.reuse-external-delta-parent = yes
# benchmark.variants.revs = any-1-extra-rev
before: 4.801442
after: 4.695810 (-1.46%, -0.07)
# benchmark.variants.revs = any-100-extra-rev
before: 4.848596
after: 4.794075 (-1.12%, -0.05)
# bin-env-vars.hg.flavor = rust
# benchmark.variants.revs = any-1-extra-rev
before: 4.818410
after: 4.700053 (-2.46%, -0.12)
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Jul 2024 14:40:38 -0400] rev 51741
pure: stringify builtin exception messages
Builtin exceptions usually want strings, and display with a wierd b'' prefix if
given bytes.