# HG changeset patch # User Matt Harbison # Date 1726172878 14400 # Node ID 1c5810ce737e85d94d53b39f23561972357a65ce # Parent f4733654f144dcea308656dce9f91165c84d87d3 typing: add `from __future__ import annotations` to remaining source files Most of these look newer than when the original imports referenced in the previous commit were dropped, so these weren't covered by the backout. These were found with: hg files mercurial hgext hgext3rd -I '**.py' -X '**/thirdparty' \ | xargs grep -L 'from __future__ import annotations' All of the `__init__.py` files that finds are empty, so those were ignored and the rest manually edited. diff -r f4733654f144 -r 1c5810ce737e hgext/purge.py --- a/hgext/purge.py Mon Sep 16 15:36:44 2024 +0200 +++ b/hgext/purge.py Thu Sep 12 16:27:58 2024 -0400 @@ -36,4 +36,7 @@ # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should # be specifying the version(s) of Mercurial they are tested with, or # leave the attribute unspecified. + +from __future__ import annotations + testedwith = b'ships-with-hg-core' diff -r f4733654f144 -r 1c5810ce737e mercurial/__main__.py --- a/mercurial/__main__.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/__main__.py Thu Sep 12 16:27:58 2024 -0400 @@ -1,3 +1,6 @@ +from __future__ import annotations + + def run(): from . import demandimport diff -r f4733654f144 -r 1c5810ce737e mercurial/admin/chainsaw.py --- a/mercurial/admin/chainsaw.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/admin/chainsaw.py Thu Sep 12 16:27:58 2024 -0400 @@ -19,6 +19,8 @@ variable (see :hg:`help scripting`). """ +from __future__ import annotations + import shutil from ..i18n import _ diff -r f4733654f144 -r 1c5810ce737e mercurial/admin/verify.py --- a/mercurial/admin/verify.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/admin/verify.py Thu Sep 12 16:27:58 2024 -0400 @@ -5,6 +5,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + import collections import copy import functools diff -r f4733654f144 -r 1c5810ce737e mercurial/admin_commands.py --- a/mercurial/admin_commands.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/admin_commands.py Thu Sep 12 16:27:58 2024 -0400 @@ -5,6 +5,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + from .i18n import _ from .admin import chainsaw, verify from . import error, registrar, transaction diff -r f4733654f144 -r 1c5810ce737e mercurial/bundlecaches.py --- a/mercurial/bundlecaches.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/bundlecaches.py Thu Sep 12 16:27:58 2024 -0400 @@ -3,6 +3,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + import collections import typing diff -r f4733654f144 -r 1c5810ce737e mercurial/revlogutils/concurrency_checker.py --- a/mercurial/revlogutils/concurrency_checker.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/revlogutils/concurrency_checker.py Thu Sep 12 16:27:58 2024 -0400 @@ -1,3 +1,5 @@ +from __future__ import annotations + from ..i18n import _ from .. import error diff -r f4733654f144 -r 1c5810ce737e mercurial/revlogutils/debug.py --- a/mercurial/revlogutils/debug.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/revlogutils/debug.py Thu Sep 12 16:27:58 2024 -0400 @@ -6,6 +6,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + import collections import string diff -r f4733654f144 -r 1c5810ce737e mercurial/revlogutils/randomaccessfile.py --- a/mercurial/revlogutils/randomaccessfile.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/revlogutils/randomaccessfile.py Thu Sep 12 16:27:58 2024 -0400 @@ -3,6 +3,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + import contextlib from ..i18n import _ diff -r f4733654f144 -r 1c5810ce737e mercurial/revlogutils/rewrite.py --- a/mercurial/revlogutils/rewrite.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/revlogutils/rewrite.py Thu Sep 12 16:27:58 2024 -0400 @@ -7,6 +7,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + import binascii import contextlib import os diff -r f4733654f144 -r 1c5810ce737e mercurial/stabletailgraph/stabletailsort.py --- a/mercurial/stabletailgraph/stabletailsort.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/stabletailgraph/stabletailsort.py Thu Sep 12 16:27:58 2024 -0400 @@ -19,6 +19,8 @@ optimised to operate on large production graphs. """ +from __future__ import annotations + import itertools from ..node import nullrev from .. import ancestor diff -r f4733654f144 -r 1c5810ce737e mercurial/typelib.py --- a/mercurial/typelib.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/typelib.py Thu Sep 12 16:27:58 2024 -0400 @@ -5,6 +5,8 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. +from __future__ import annotations + import typing from typing import ( diff -r f4733654f144 -r 1c5810ce737e mercurial/upgrade_utils/auto_upgrade.py --- a/mercurial/upgrade_utils/auto_upgrade.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/upgrade_utils/auto_upgrade.py Thu Sep 12 16:27:58 2024 -0400 @@ -4,6 +4,9 @@ # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. + +from __future__ import annotations + from ..i18n import _ from .. import ( diff -r f4733654f144 -r 1c5810ce737e mercurial/utils/memorytop.py --- a/mercurial/utils/memorytop.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/utils/memorytop.py Thu Sep 12 16:27:58 2024 -0400 @@ -5,6 +5,8 @@ # memorytop in strategic places to show the current memory use by allocation # site. +from __future__ import annotations + import gc import tracemalloc diff -r f4733654f144 -r 1c5810ce737e mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py Mon Sep 16 15:36:44 2024 +0200 +++ b/mercurial/utils/urlutil.py Thu Sep 12 16:27:58 2024 -0400 @@ -4,6 +4,9 @@ # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. + +from __future__ import annotations + import os import re as remod import socket