/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/bzrdir_implementations/test_bzrdir.py

Merged bzr.dev r3374.

Show diffs side-by-side

added added

removed removed

Lines of Context:
537
537
            target.open_repository())
538
538
        target.open_workingtree().revert()
539
539
 
 
540
    def test_clone_on_transport_preserves_repo_format(self):
 
541
        if self.bzrdir_format == bzrdir.format_registry.make_bzrdir('default'):
 
542
            format = 'knit'
 
543
        else:
 
544
            format = None
 
545
        source_branch = self.make_branch('source', format=format)
 
546
        # Ensure no format data is cached
 
547
        a_dir = bzrlib.branch.Branch.open_from_transport(
 
548
            self.get_transport('source')).bzrdir
 
549
        target_transport = a_dir.root_transport.clone('..').clone('target')
 
550
        target_bzrdir = a_dir.clone_on_transport(target_transport)
 
551
        target_repo = target_bzrdir.open_repository()
 
552
        self.assertEqual(target_repo._format, source_branch.repository._format)
 
553
 
540
554
    def test_revert_inventory(self):
541
555
        tree = self.make_branch_and_tree('source')
542
556
        self.build_tree(['source/foo'])
1582
1596
                # its still held by the explicit lock we took, and the break
1583
1597
                # lock should not have touched it.
1584
1598
                repo = thisdir.open_repository()
1585
 
                orig_default = lockdir._DEFAULT_TIMEOUT_SECONDS
1586
 
                try:
1587
 
                    lockdir._DEFAULT_TIMEOUT_SECONDS = 1
1588
 
                    self.assertRaises(errors.LockContention, repo.lock_write)
1589
 
                finally:
1590
 
                    lockdir._DEFAULT_TIMEOUT_SECONDS = orig_default
 
1599
                self.assertRaises(errors.LockContention, repo.lock_write)
1591
1600
        finally:
1592
1601
            unused_repo.unlock()
1593
1602
        self.assertRaises(errors.LockBroken, master.unlock)