~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
415
415
        self.assertNotEqual(dir.transport.base, target.transport.base)
416
416
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
417
417
                                    ['./.bzr/stat-cache',
 
418
                                     './.bzr/checkout/dirstate',
418
419
                                     './.bzr/checkout/stat-cache',
419
420
                                     './.bzr/checkout/merge-hashes',
420
421
                                     './.bzr/merge-hashes',
433
434
        self.skipIfNoWorkingTree(target)
434
435
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
435
436
                                    ['./.bzr/stat-cache',
 
437
                                     './.bzr/checkout/dirstate',
436
438
                                     './.bzr/checkout/stat-cache',
437
439
                                     './.bzr/checkout/merge-hashes',
438
440
                                     './.bzr/merge-hashes',
442
444
        target.open_workingtree().revert([])
443
445
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
444
446
                                    ['./.bzr/stat-cache',
 
447
                                     './.bzr/checkout/dirstate',
445
448
                                     './.bzr/checkout/stat-cache',
446
449
                                     './.bzr/checkout/merge-hashes',
447
450
                                     './.bzr/merge-hashes',
448
451
                                     './.bzr/repository/inventory.knit',
449
452
                                     ])
450
453
 
451
 
 
452
454
    def test_clone_bzrdir_tree_branch_reference(self):
453
455
        # a tree with a branch reference (aka a checkout) 
454
456
        # should stay a checkout on clone.
850
852
                                    [
851
853
                                     './.bzr/branch/branch.conf',
852
854
                                     './.bzr/branch/parent',
 
855
                                     './.bzr/checkout/dirstate',
853
856
                                     './.bzr/checkout/stat-cache',
854
857
                                     './.bzr/checkout/inventory',
855
858
                                     './.bzr/inventory',
1325
1328
        text = dir._format.get_format_description()
1326
1329
        self.failUnless(len(text))
1327
1330
 
 
1331
    def test_retire_bzrdir(self):
 
1332
        bd = self.make_bzrdir('.')
 
1333
        # must not overwrite existing directories
 
1334
        self.build_tree(['.bzr.retired.0/', '.bzr.retired.0/junk',])
 
1335
        self.failUnlessExists('.bzr')
 
1336
        bd.retire_bzrdir()
 
1337
        self.failIfExists('.bzr')
 
1338
        self.failUnlessExists('.bzr.retired.1')
1328
1339
 
1329
1340
class TestBreakLock(TestCaseWithBzrDir):
1330
1341
 
1420
1431
        bzrlib.ui.ui_factory.stdin = StringIO("y\ny\ny\ny\n")
1421
1432
        try:
1422
1433
            tree.bzrdir.break_lock()
1423
 
        except NotImplementedError:
 
1434
        except (NotImplementedError, errors.LockActive):
1424
1435
            # bzrdir does not support break_lock
 
1436
            # or one of the locked objects (currently only tree does this)
 
1437
            # raised a LockActive because we do still have a live locked
 
1438
            # object.
1425
1439
            tree.unlock()
1426
1440
            return
1427
1441
        self.assertEqual("y\n", bzrlib.ui.ui_factory.stdin.read())