/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Martin Pool
  • Date: 2008-08-04 07:55:41 UTC
  • mto: This revision was merged to the branch mainline in revision 3605.
  • Revision ID: mbp@sourcefrog.net-20080804075541-jka7smxkix7ozvb1
Make tests for stacked upgrade scenario-based

Show diffs side-by-side

added added

removed removed

Lines of Context:
1010
1010
        inter_repo.fetch('rev-3', pb)
1011
1011
        self.assertEqual(2, pb.last_cnt)
1012
1012
        self.assertEqual(2, pb.last_total)
1013
 
 
1014
 
 
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
1019
 
 
1020
 
    def test_stack_upgrade(self):
1021
 
        """Correct checks when stacked-on repository is upgraded.
1022
 
        
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 
1025
 
        repository.
1026
 
        """
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)
1041
 
        # and now it's ok
1042
 
        stacked = bzrdir.BzrDir.open('stacked')
1043
 
        stacked.open_branch().check()