diff -r b1daf3064362 -r e02c36478284 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Fri Dec 20 21:14:30 2024 -0500 +++ b/mercurial/hgweb/webutil.py Sat Dec 21 17:43:38 2024 -0500 @@ -12,6 +12,7 @@ import difflib import os import re +import typing from ..i18n import _ from ..node import hex, short @@ -43,7 +44,16 @@ from ..utils import stringutil -archivespecs = util.sortdict( +if typing.TYPE_CHECKING: + from typing import ( + Optional, + ) + + ArchiveSpecT = tuple[bytes, bytes, bytes, Optional[bytes]] + """Tuple of (mime-type, archive-type, file extension, encoding)""" + + +archivespecs: util.sortdict[bytes, ArchiveSpecT] = util.sortdict( ( (b'zip', (b'application/zip', b'zip', b'.zip', None)), (b'gz', (b'application/x-gzip', b'tgz', b'.tar.gz', None)),