Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 12:02:38 +0200] rev 51840
profiling: improve 3.12 error message for calling lsprof twice
Python 3.12 prevent lsprof to be enabled if it is already enabled. This break
the use of lsprof in `hg serve` as both the initial `serve` command and the
request serving want to profile.
The "stat" profiler (the default) does not have this problem, so we focus on
improving the error message for now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Sep 2024 00:41:37 +0200] rev 51839
test: display server error log in test-profile.t
This will help us to catch error with Python 3.12
Joerg Sonnenberger <joerg@bec.de> [Wed, 15 Nov 2023 22:11:34 +0100] rev 51838
archive: defer opening the output until a file is matched
Before, if no file is matched, an error is thrown, but the archive is
created anyway. When using hgweb, an error 500 is returned as the
response body already exists when the error is seen.
Afterwards, the archive is created before the first match is emitted.
If no match is found, no archive is created. This is more consistent
behavior as an empty archive is not a representable in all output
formats, e.g. tar archives.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 05 Sep 2024 13:37:24 +0200] rev 51837
run-tests: add color to the progress output
More color is useful to me.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 10 Sep 2024 22:26:23 +0200] rev 51836
python-compat: drop support for Python3.6 and 3.7
As discussed on the mailing list¹, these are old version that seems safe to
drop. Python 3.8 comes with various improvement especially regarding typing
capabilities.
[1] https://lists.mercurial-scm.org/pipermail/mercurial-devel/2024-July/297998.html
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 10 Sep 2024 21:19:36 +0200] rev 51835
ci: drop path manipulation that we do not need anymore
The CI image has a squarer setup now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 06 Sep 2024 02:12:19 +0200] rev 51834
brancing: merge stable into default
Matt Harbison <mharbison@atto.com> [Thu, 05 Sep 2024 15:37:14 -0400] rev 51833
setup: handle removal of old MSVC compiler from setuptools 65.0 (
issue6910)
It was removed a few years ago[1]. When trying to reproduce locally using a
clean py3.12 as called out in the bug report, `setuptools` wasn't installed at
all, and needed a `pip install` to fix a `ModuleNotFoundError` when building
locally. Maybe that needs to be in the requirements clause now.
It looks like this "private" module was added in setuptools 48.0.[2] I can't
find a changelog of what version was included in which version of python, and
the changelog for pip has a huge gap between when it called out 67.6.1 in `pip`
23.1 (2023-04-15), and 41.4.0 in `pip` 19.3 (2019-10-14).[3] So, we'll just add
to the existing code instead of replacing it, for safety.
[1] https://github.com/pypa/setuptools/commit/
cc017c77948737d131f683e0c25cd37bc639b8fc
[2] https://github.com/pypa/setuptools/commit/
d034a5ec7f707499139f90eb846b9e720923124c
[3] https://pip.pypa.io/en/stable/news/
Joerg Sonnenberger <joerg@bec.de> [Wed, 28 Aug 2024 23:25:26 +0200] rev 51832
utils: accept bytearray arguments for escapestr
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 16:02:50 +0200] rev 51831
http: simplify
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 14:16:43 +0200] rev 51830
http: use urllib's cookie handler
Split the logic for loading the cookies based on the configuration in a
helper function and otherwise use the library implementation directly.
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 13:22:23 +0200] rev 51829
http: reuse Python's implementation of read/readline/readinto
Since Python 3 already provides a working implementation of readline,
there is no need for our own buffering implementation. Reduce the
code to transfer accounting only.
Joerg Sonnenberger <joerg@bec.de> [Sun, 30 Jun 2024 02:46:53 +0200] rev 51828
debugwireproto: redo logging to also work for https
Joerg Sonnenberger <joerg@bec.de> [Fri, 28 Jun 2024 16:26:06 +0200] rev 51827
urllib2: redo response.readlines addition via class patching
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 22:15:05 -0400] rev 51826
typing: lock in new pytype gains from making revlog related classes typeable
These were pretty clean changes in the pyi files from earlier in this series, so
add them to the code to make it more understandable.
There's one more trivial hint that can be added to the return of
`mercurial.revlogutils.rewrite._filelog_from_filename()`, however it needs to be
imported from '..' under the conditional of `typing.TYPE_CHECKING`, and that
seems to confuse the import checker- possibly because there's already an import
block from that level. (I would have expected a message about multiple import
statements in this case, but got one about higher level imports should come
first, no matter where I put the import statement.)
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 00:07:05 -0400] rev 51825
typing: add types to `revlog.revlogproblem`
These attrs showed as `Any` after the previous commit made the class visible to
pytype.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 19 Aug 2024 22:46:09 -0400] rev 51824
typing: make the revlog classes known to pytype
These are the same changes as
c1d7ac70980b and
45270e286bdc made to dirstate,
for the same reasons.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 19 Aug 2024 22:27:43 -0400] rev 51823
typing: make the manifest classes known to pytype
These are the same changes as
c1d7ac70980b and
45270e286bdc made to dirstate,
for the same reasons. The migration away from decorating the classes with
`@interfaceutil.implementer` was started back in
3e9a660b074a, but missed one.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 19 Aug 2024 22:21:16 -0400] rev 51822
typing: make the filelog class known to pytype
These are the same changes as
c1d7ac70980b and
45270e286bdc made to dirstate,
for the same reasons.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 17:41:57 -0400] rev 51821
remotefilelog: adapt the `debugindex` command to past API changes
Pytype was missing these problems because it's currently inferring the classes
for `filelog` and `revlog` to be `Any`. When that's fixed, these were flagged,
so fix these first.
The `filelog` class used to subclass `revlog`, but that was changed back in
1541e1a8e87d (with most or all of the "lost" attributes being forwarded to the
embedded `revlog` attribute at that time). These forwarded references were
dropped over time, and this command has been broken at least as far back as
68282a7b29a7 when the `version` field was dropped. Most of the fixes were as
simple as calling the accessor for the embedded `revlog` member, but the general
delta feature detection was a bit more involved- I copied the detection for it
from `mercurial.revlogutils.debug.debug_revlog()`.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 16:13:14 -0400] rev 51820
typing: add type hints to the `opener` attributes and arguments of revlog
When making revlog and filelog classes visible to pytype, it got confused quite
a bit in `mercurial/revlogutils/rewrite.py`, thinking it had a plain `Callable`,
and flagging additional methods on it like `join()` and `rename()`. I couldn't
figure out how it reduced to that (and PyCharm flagged `opener` references as
`Any`), but this makes it happy. So make this change before making the classes
visible.
The vfs class hierarchy is a bit wonky (e.g. `filteredvfs` is not a `vfs`), so
this may need to be revisited with a Protocol class that covers all of the `vfs`
classes. But for now, everything works.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 21 Aug 2024 16:09:22 -0400] rev 51819
remotefilelog: honor the `--format` arg of the `debugindex` command
Flagged by PyCharm while investigating pytype spew. The other `**opts` above
are already accessed as str. I've never used remotefilelog, and don't have a
repo to test this on, so I'm trusting the nearby code.
Manuel Jacob <me@manueljacob.de> [Wed, 07 Aug 2024 22:05:36 +0200] rev 51818
merge: sort filemap only if requested by the caller
The name `sorted` refers to a built-in function, which is always true, so the else branch of this if statement was dead code.
Because, with this fix, the function can iterate over the dict items while yielding values, the dict should not change size while the generator is running. Because of that, it is required to re-introduce code that makes a caller copy the filemap before modification, which was removed in
3c783ff08d40cbaf36eb27ffe1d296718c0f1d77 (that changeset also introduced the filemap() method including the bug that’s being fixed by this changeset).
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Aug 2024 22:47:11 -0400] rev 51817
shelve: consistently convert exception to bytes via `stringutil.forcebytestr`
The other two places in this module use this, and past experience shows that
this method does a nicer job. I'm not sure why we're converting to bytes here-
`KeyError` is built-in and will have str attrs, and `RepoLookupError` is a
subclass of the built-in `Exception` class (not `errors.Error`, which is
allegedly the baseclass for all Mercurial exceptions).