1010
1010
inter_repo.fetch('rev-3', pb)
1011
1011
self.assertEqual(2, pb.last_cnt)
1012
1012
self.assertEqual(2, pb.last_total)
1015
class TestStackUpgrade(TestCaseWithTransport):
1016
# TODO: This should possibly be repeated for all stacking repositories,
1017
# pairwise by rich/non-rich format; should possibly also try other kinds
1018
# of upgrades like knit->pack. -- mbp 20080804
1020
def test_stack_upgrade(self):
1021
"""Correct checks when stacked-on repository is upgraded.
1023
We initially stack on a repo with the same rich root support,
1024
we then upgrade it and should fail, we then upgrade the overlaid
1027
base = self.make_branch_and_tree('base', format='1.6')
1028
self.build_tree(['base/foo'])
1029
base.commit('base commit')
1030
# make another one stacked
1031
stacked = base.bzrdir.sprout('stacked', stacked=True)
1032
# you can't stack on something with incompatible data
1033
from bzrlib.upgrade import upgrade
1034
new_format = bzrdir.format_registry.make_bzrdir('1.6-rich-root')
1035
upgrade('base', new_format)
1036
stacked = bzrdir.BzrDir.open('stacked')
1037
self.assertRaises(errors.IncompatibleRepositories,
1038
stacked.open_branch)
1039
# but we can upgrade the stacked repository
1040
upgrade('stacked', new_format)
1042
stacked = bzrdir.BzrDir.open('stacked')
1043
stacked.open_branch().check()