~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-05 12:45:41 UTC
  • mfrom: (6190 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20111005124541-chv6scmle72z72gq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
    def test_record_initial_ghost(self):
216
216
        """Branches should support having ghosts."""
217
217
        wt = self.make_branch_and_tree('.')
 
218
        if not wt.branch.repository._format.supports_ghosts:
 
219
            raise tests.TestNotApplicable("repository format does not "
 
220
                "support ghosts")
218
221
        wt.set_parent_ids(['non:existent@rev--ision--0--2'],
219
222
            allow_leftmost_as_ghost=True)
220
223
        self.assertEqual(['non:existent@rev--ision--0--2'],
228
231
    def test_record_two_ghosts(self):
229
232
        """Recording with all ghosts works."""
230
233
        wt = self.make_branch_and_tree('.')
 
234
        if not wt.branch.repository._format.supports_ghosts:
 
235
            raise tests.TestNotApplicable("repository format does not "
 
236
                "support ghosts")
231
237
        wt.set_parent_ids([
232
238
                'foo@azkhazan-123123-abcabc',
233
239
                'wibble@fofof--20050401--1928390812',
418
424
        try:
419
425
            repo = self.make_repository('.', shared=True)
420
426
        except errors.IncompatibleFormat:
421
 
            return
 
427
            raise tests.TestNotApplicable("requires shared repository support")
422
428
        child_transport = repo.bzrdir.root_transport.clone('child')
423
429
        child_transport.mkdir('.')
424
430
        try:
425
431
            child_dir = self.bzrdir_format.initialize_on_transport(child_transport)
426
432
        except errors.UninitializableFormat:
427
 
            return
 
433
            raise tests.TestNotApplicable("control dir format not initializable")
428
434
        try:
429
435
            child_branch = self.branch_format.initialize(child_dir)
430
436
        except errors.UninitializableFormat:
904
910
    def test_fallbacks_not_opened(self):
905
911
        stacked = self.make_branch_with_fallback()
906
912
        self.get_transport('').rename('fallback', 'moved')
907
 
        reopened = stacked.bzrdir.open_branch(ignore_fallbacks=True)
 
913
        reopened_dir = bzrdir.BzrDir.open(stacked.base)
 
914
        reopened = reopened_dir.open_branch(ignore_fallbacks=True)
908
915
        self.assertEqual([], reopened.repository._fallback_repositories)
909
916
 
910
917
    def test_fallbacks_are_opened(self):
911
918
        stacked = self.make_branch_with_fallback()
912
 
        reopened = stacked.bzrdir.open_branch(ignore_fallbacks=False)
 
919
        reopened_dir = bzrdir.BzrDir.open(stacked.base)
 
920
        reopened = reopened_dir.open_branch(ignore_fallbacks=False)
913
921
        self.assertLength(1, reopened.repository._fallback_repositories)
914
922
 
915
923