comparison mercurial/bundlecaches.py @ 51599:9b51a4fb0f96

bundlespec: type the _bundlespeccontentopts dictionary If only we had a tool to detect the kind of stupid error we just fixed? ho wait.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 09 Apr 2024 14:37:24 +0200
parents 4a9d0898bf16
children f610d705c3ca
comparison
equal deleted inserted replaced
51598:4a9d0898bf16 51599:9b51a4fb0f96
4 # GNU General Public License version 2 or any later version. 4 # GNU General Public License version 2 or any later version.
5 5
6 import collections 6 import collections
7 7
8 from typing import ( 8 from typing import (
9 Dict,
10 Union,
9 cast, 11 cast,
10 ) 12 )
11 13
12 from .i18n import _ 14 from .i18n import _
13 15
104 b'packed1': b's1', 106 b'packed1': b's1',
105 b'bundle2': b'02', # legacy 107 b'bundle2': b'02', # legacy
106 } 108 }
107 109
108 # Maps bundle version with content opts to choose which part to bundle 110 # Maps bundle version with content opts to choose which part to bundle
109 _bundlespeccontentopts = { 111 _bundlespeccontentopts: Dict[bytes, Dict[bytes, Union[bool, bytes]]] = {
110 b'v1': { 112 b'v1': {
111 b'changegroup': True, 113 b'changegroup': True,
112 b'cg.version': b'01', 114 b'cg.version': b'01',
113 b'obsolescence': False, 115 b'obsolescence': False,
114 b'phases': False, 116 b'phases': False,