- Sep 16, 2024
-
-
Matt Harbison authored
Now that py36 is no longer supported, we can postpone annotation evaluation. This means that the quoting is usually optional (for things imported under the guard of `if typing.TYPE_CHECKING:` to avoid circular imports), and there's less overhead on startup[1]. There may be some missing here. I backed out 6000f5b25c9b (which removed the `from __future__ import ...` that was supporting py2), reverted the changes in `contrib/`, `doc/`, and `tests/`, and then ran: $ hg status -n --change . | \ xargs sed -i -e 's/from __future__ import .*$/from __future__ import annotations/' There were some minor tweaks needed when reviewing (mostly making the spacing around the import consistent, and `mercurial/testing/__init__.py` had a multiline import that wasn't fully rewritten. [1] https://docs.python.org/3/whatsnew/3.7.html#pep-563-postponed-evaluation-of-annotations
-
Matt Harbison authored
Black was not adding them until the next changeset introduced a bunch of `from __future__ import annotations` to most file. Since it make the next changeset hard to read we introduce them in advance.
-
- Sep 12, 2024
-
-
Matt Harbison authored
I was waiting until 3.8 to use `Literal` to fix this, but there's also the ":" and "|" characters that are passed along here, meant only for the non-gz archive types. But manipulating what the local caller passes is silly- we know we're writing, so just open it for writing. As an added bonus, PyCharm stops flagging the call too (since it doesn't know about pytype suppression comments).
-
Matt Harbison authored
Somewhere between cd72a88c5599 and 2fd44b3dcc33, pytype changed the return type from `Tuple[_T1, Any, bool]` to `Any`. Both are wrong. `mdiff.patches()` is an alias for `mpatch.patches()`, which is selected via module policy (and breaks the ability to infer the types). However, `cext`, `cffi`, and `pure` implementations all agree it returns bytes.
-
Matt Harbison authored
Somewhere between 454feddab720 and cd72a88c5599, pytype changed how it inferred the return type in `extdiff.py` from Tuple[Any, List[Tuple[bytes, Any, os.stat_result]]] to Tuple[Any, List[nothing]] It also changed the return type in `archival.py` from `Any` to `NoReturn`. Fix those up, and also the obvious parameter types while we're here.
-
- Jun 19, 2024
-
-
Raphaël Gomès authored
This was probably fine, but it could become not fine at some point.
-
Raphaël Gomès authored
No point in trying to fetch sidedata if there isn't a sidedata file.
-
Raphaël Gomès authored
We're always returning a tuple even though only the raw text is being used, and we're rebuilding another tuple again higher. As a bonus, this will remove one tuple creation and deletion per `raw_text` call, hence fewer gc calls, etc.
-
Raphaël Gomès authored
-
- Sep 12, 2024
-
-
Pierre-Yves David authored
This is a very hot function.
-
Pierre-Yves David authored
-
Pierre-Yves David authored
-
- Jun 19, 2024
-
-
Raphaël Gomès authored
These will be needed for future patches of this series to interpret more complex/different config values.
-
- Mar 26, 2024
-
-
Raphaël Gomès authored
There is no use of writable buffers anywhere in the code, and this helps us make sure we don't get into unsound territory when sharing memory with Rust. This `toreadonly` method was not available in Python 3.6, but we dropped the support for it earlier that week, so no need for any compatibility code.
-
- Sep 05, 2024
-
-
Matt Harbison authored
I noticed this was flagged with `DeprecationWarning` in py3.12 with `setuptools` 74.1.2, and it suggested `shutil.which()` instead. The signatures aren't the same, but the additional `mode` argument in the middle of the latter defaults to `os.F_OK | os.X_OK`, which maintains the same semantics.
-
Matt Harbison authored
I don't see this when building on Windows with py3.8 or py3.12, so either the code was fixed, or (more likely) the compiler stopped warning about it some time after VS 2008. If we do have to put this back, it would probably be better to put a `#pragma` in a header file somewhere, and avoid `setuptools` technical debt.
-
- Sep 10, 2024
-
-
Pierre-Yves David authored
The rust-cpython binding got 3.12 support very recently, it is worse keeping on a tighter watch.
-
- Aug 28, 2024
-
-
Pierre-Yves David authored
It seems like a good idea to be able to test the lowest version we support. And there have been enougth issue with 3.12 that we need to be able to make sur we do not break it. We should probably get a matrix setup for more version and flavor, but that is a simple and efficient start.
-
- Sep 05, 2024
-
-
Pierre-Yves David authored
Censor is not marked as experimental and should be documented I am not doing this on stable because the help markup change it is using seems more suitable for default.
-
Pierre-Yves David authored
The config items defined in the configitems.toml file can already hold their documentation. Having some way to automatically insert it was a long standing low hanging fruit. So I did a first implementation on that. It fairly simple, but it open the door to more. It will be used in the next changeset.
-
- Sep 11, 2024
-
-
Pierre-Yves David authored
The test has flakyness where the order of a few commit swap. This is an attempt at avoiding that.
-
- Sep 12, 2024
-
-
Pierre-Yves David authored
-
- Sep 11, 2024
-
-
Pierre-Yves David authored
The ls profiler no longer works for that. As the lsprof profiler is not default and not great is general, lets side step the issue for now.
-
Pierre-Yves David authored
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.
-
- Nov 15, 2023
-
-
Jörg Sonnenberger authored
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.
-
- Sep 05, 2024
-
-
Pierre-Yves David authored
More color is useful to me.
-
- Sep 10, 2024
-
-
Pierre-Yves David authored
This will help us to catch error with Python 3.12
-
Pierre-Yves David authored
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 authored
The CI image has a squarer setup now.
-
- Sep 06, 2024
-
-
Pierre-Yves David authored
-
- Sep 05, 2024
-
-
Matt Harbison authored
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/
-
- Aug 28, 2024
-
-
Jörg Sonnenberger authored
-
- Jun 30, 2024
-
-
Jörg Sonnenberger authored
-
Jörg Sonnenberger authored
Split the logic for loading the cookies based on the configuration in a helper function and otherwise use the library implementation directly.
-
Jörg Sonnenberger authored
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.
-
Jörg Sonnenberger authored
-
- Jun 28, 2024
-
-
Jörg Sonnenberger authored
-
- Aug 07, 2024
-
-
Manuel Jacob authored
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 3c783ff08d40 (that changeset also introduced the filemap() method including the bug that’s being fixed by this changeset).
-
- Aug 22, 2024
-
-
Matt Harbison authored
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.)
-
- Aug 20, 2024
-
-
Matt Harbison authored
These attrs showed as `Any` after the previous commit made the class visible to pytype.
-