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

  • Committer: Jelmer Vernooij
  • Date: 2011-10-06 00:48:21 UTC
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20111006004821-064zjgmyt67h67lg
Fix locking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    )
34
34
from bzrlib.osutils import (
35
35
    getcwd,
36
 
    lexists,
37
36
    )
38
37
from bzrlib.tests.test_bundle import V4BundleTester
39
38
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
308
307
        # other tests.
309
308
        self.assertIsInstance(control._format, bzrdir.BzrDirMetaFormat1)
310
309
        b = control.open_branch()
 
310
        self.addCleanup(b.lock_read().unlock)
311
311
        self.assertEquals(b._revision_history(),
312
312
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
313
313
            'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
323
323
        self.assertIsInstance(
324
324
            control._format,
325
325
            bzrdir.BzrDirFormat.get_default_format().__class__)
 
326
        self.addCleanup(b.lock_read().unlock)
326
327
        rh = b._revision_history()
327
328
        eq(rh,
328
329
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
378
379
        self.build_tree_contents(_ghost_template)
379
380
        upgrade.upgrade(u'.')
380
381
        b = branch.Branch.open(u'.')
 
382
        self.addCleanup(b.lock_read().unlock)
381
383
        revision_id = b._revision_history()[1]
382
384
        rev = b.repository.get_revision(revision_id)
383
385
        eq(len(rev.parent_ids), 2)
407
409
        self.build_tree_contents(_upgrade_dir_template)
408
410
        upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1())
409
411
        tree = workingtree.WorkingTree.open('.')
 
412
        self.addCleanup(tree.lock_read().unlock)
410
413
        self.assertEqual([tree.branch._revision_history()[-1]],
411
414
            tree.get_parent_ids())
412
415