/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 breezy/tests/test_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 18:35:30 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7178.
  • Revision ID: jelmer@jelmer.uk-20181116183530-ue8yx60h5tinl2wy
Merge more-cleanups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
515
515
        tree = self.make_branch_and_tree('.', format)
516
516
        tree.commit("Dull commit", rev_id=b"dull")
517
517
        revision_tree = tree.branch.repository.revision_tree(b'dull')
518
 
        revision_tree.lock_read()
519
 
        try:
 
518
        with revision_tree.lock_read():
520
519
            self.assertRaises(errors.NoSuchFile, revision_tree.get_file_lines,
521
 
                              u'', revision_tree.get_root_id())
522
 
        finally:
523
 
            revision_tree.unlock()
 
520
                u'')
524
521
        format = bzrdir.BzrDirMetaFormat1()
525
522
        format.repository_format = knitrepo.RepositoryFormatKnit3()
526
523
        upgrade.Convert('.', format)
527
524
        tree = workingtree.WorkingTree.open('.')
528
525
        revision_tree = tree.branch.repository.revision_tree(b'dull')
529
 
        revision_tree.lock_read()
530
 
        try:
531
 
            revision_tree.get_file_lines(u'', revision_tree.get_root_id())
532
 
        finally:
533
 
            revision_tree.unlock()
 
526
        with revision_tree.lock_read():
 
527
            revision_tree.get_file_lines(u'')
534
528
        tree.commit("Another dull commit", rev_id=b'dull2')
535
529
        revision_tree = tree.branch.repository.revision_tree(b'dull2')
536
530
        revision_tree.lock_read()
537
531
        self.addCleanup(revision_tree.unlock)
538
 
        self.assertEqual(
539
 
            b'dull',
540
 
            revision_tree.get_file_revision(u'', revision_tree.get_root_id()))
 
532
        self.assertEqual(b'dull', revision_tree.get_file_revision(u''))
541
533
 
542
534
    def test_supports_external_lookups(self):
543
535
        format = bzrdir.BzrDirMetaFormat1()