diff --git a/hgext/purge.py b/hgext/purge.py --- a/hgext/purge.py +++ b/hgext/purge.py @@ -36,4 +36,7 @@ the default, unless the extension is ena # 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 --git a/mercurial/__main__.py b/mercurial/__main__.py --- a/mercurial/__main__.py +++ b/mercurial/__main__.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + def run(): from . import demandimport diff --git a/mercurial/admin/chainsaw.py b/mercurial/admin/chainsaw.py --- a/mercurial/admin/chainsaw.py +++ b/mercurial/admin/chainsaw.py @@ -19,6 +19,8 @@ It is recommended to run these commands variable (see :hg:`help scripting`). """ +from __future__ import annotations + import shutil from ..i18n import _ diff --git a/mercurial/admin/verify.py b/mercurial/admin/verify.py --- a/mercurial/admin/verify.py +++ b/mercurial/admin/verify.py @@ -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 --git a/mercurial/admin_commands.py b/mercurial/admin_commands.py --- a/mercurial/admin_commands.py +++ b/mercurial/admin_commands.py @@ -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 --git a/mercurial/bundlecaches.py b/mercurial/bundlecaches.py --- a/mercurial/bundlecaches.py +++ b/mercurial/bundlecaches.py @@ -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 --git a/mercurial/revlogutils/concurrency_checker.py b/mercurial/revlogutils/concurrency_checker.py --- a/mercurial/revlogutils/concurrency_checker.py +++ b/mercurial/revlogutils/concurrency_checker.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from ..i18n import _ from .. import error diff --git a/mercurial/revlogutils/debug.py b/mercurial/revlogutils/debug.py --- a/mercurial/revlogutils/debug.py +++ b/mercurial/revlogutils/debug.py @@ -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 --git a/mercurial/revlogutils/randomaccessfile.py b/mercurial/revlogutils/randomaccessfile.py --- a/mercurial/revlogutils/randomaccessfile.py +++ b/mercurial/revlogutils/randomaccessfile.py @@ -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 --git a/mercurial/revlogutils/rewrite.py b/mercurial/revlogutils/rewrite.py --- a/mercurial/revlogutils/rewrite.py +++ b/mercurial/revlogutils/rewrite.py @@ -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 --git a/mercurial/stabletailgraph/stabletailsort.py b/mercurial/stabletailgraph/stabletailsort.py --- a/mercurial/stabletailgraph/stabletailsort.py +++ b/mercurial/stabletailgraph/stabletailsort.py @@ -19,6 +19,8 @@ This module and implementation are exper optimised to operate on large production graphs. """ +from __future__ import annotations + import itertools from ..node import nullrev from .. import ancestor diff --git a/mercurial/typelib.py b/mercurial/typelib.py --- a/mercurial/typelib.py +++ b/mercurial/typelib.py @@ -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 --git a/mercurial/upgrade_utils/auto_upgrade.py b/mercurial/upgrade_utils/auto_upgrade.py --- a/mercurial/upgrade_utils/auto_upgrade.py +++ b/mercurial/upgrade_utils/auto_upgrade.py @@ -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 --git a/mercurial/utils/memorytop.py b/mercurial/utils/memorytop.py --- a/mercurial/utils/memorytop.py +++ b/mercurial/utils/memorytop.py @@ -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 --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -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