83
92
for optimiser_class in InterRepository._optimisers:
84
93
format_to_test = optimiser_class._get_repo_format_to_test()
85
94
if format_to_test is not None:
86
add_combo(optimiser_class.__name__, format_to_test, format_to_test)
95
add_combo(optimiser_class, format_to_test, format_to_test)
87
96
# if there are specific combinations we want to use, we can add them
88
97
# here. We want to test rich root upgrading.
89
98
# XXX: although we attach InterRepository class names to these scenarios,
90
99
# there's nothing asserting that these labels correspond to what is
92
add_combo('InterRepository',
93
weaverepo.RepositoryFormat5(),
94
knitrepo.RepositoryFormatKnit3())
95
add_combo('InterRepository',
101
def force_known_graph(testcase):
102
from bzrlib.fetch import Inter1and2Helper
103
testcase.overrideAttr(Inter1and2Helper, 'known_graph_threshold', -1)
104
# Gather extra scenarios from the repository implementations,
105
# as InterRepositories can be used by Repository implementations
106
# they aren't aware of.
107
for module_name in format_registry._get_all_modules():
108
module = pyutils.get_named_object(module_name)
110
get_extra_interrepo_test_combinations = getattr(
112
"get_extra_interrepo_test_combinations")
113
except AttributeError:
115
for (interrepo_cls, from_format, to_format) in (
116
get_extra_interrepo_test_combinations()):
117
add_combo(interrepo_cls, from_format, to_format)
118
add_combo(InterRepository,
96
119
knitrepo.RepositoryFormatKnit1(),
97
120
knitrepo.RepositoryFormatKnit3())
98
add_combo('InterKnitRepo',
121
add_combo(knitrepo.InterKnitRepo,
99
122
knitrepo.RepositoryFormatKnit1(),
100
123
pack_repo.RepositoryFormatKnitPack1())
101
add_combo('InterKnitRepo',
124
add_combo(knitrepo.InterKnitRepo,
102
125
pack_repo.RepositoryFormatKnitPack1(),
103
126
knitrepo.RepositoryFormatKnit1())
104
add_combo('InterKnitRepo',
127
add_combo(knitrepo.InterKnitRepo,
105
128
knitrepo.RepositoryFormatKnit3(),
106
129
pack_repo.RepositoryFormatKnitPack3())
107
add_combo('InterKnitRepo',
130
add_combo(knitrepo.InterKnitRepo,
108
131
pack_repo.RepositoryFormatKnitPack3(),
109
132
knitrepo.RepositoryFormatKnit3())
110
add_combo('InterKnitRepo',
133
add_combo(knitrepo.InterKnitRepo,
111
134
pack_repo.RepositoryFormatKnitPack3(),
112
135
pack_repo.RepositoryFormatKnitPack4())
113
add_combo('InterDifferingSerializer',
136
add_combo(InterDifferingSerializer,
114
137
pack_repo.RepositoryFormatKnitPack1(),
115
138
pack_repo.RepositoryFormatKnitPack6RichRoot())
116
add_combo('InterDifferingSerializer',
139
add_combo(InterDifferingSerializer,
140
pack_repo.RepositoryFormatKnitPack1(),
141
pack_repo.RepositoryFormatKnitPack6RichRoot(),
143
label='InterDifferingSerializer+get_known_graph_ancestry')
144
add_combo(InterDifferingSerializer,
117
145
pack_repo.RepositoryFormatKnitPack6RichRoot(),
118
146
groupcompress_repo.RepositoryFormat2a())
119
add_combo('InterDifferingSerializer',
147
add_combo(InterDifferingSerializer,
120
148
groupcompress_repo.RepositoryFormat2a(),
121
149
pack_repo.RepositoryFormatKnitPack6RichRoot())
122
add_combo('InterRepository',
123
groupcompress_repo.RepositoryFormatCHK2(),
124
groupcompress_repo.RepositoryFormat2a())
125
add_combo('InterDifferingSerializer',
126
groupcompress_repo.RepositoryFormatCHK1(),
127
groupcompress_repo.RepositoryFormat2a())