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()
518
with revision_tree.lock_read():
520
519
self.assertRaises(errors.NoSuchFile, revision_tree.get_file_lines,
521
u'', revision_tree.get_root_id())
523
revision_tree.unlock()
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()
531
revision_tree.get_file_lines(u'', revision_tree.get_root_id())
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)
540
revision_tree.get_file_revision(u'', revision_tree.get_root_id()))
532
self.assertEqual(b'dull', revision_tree.get_file_revision(u''))
542
534
def test_supports_external_lookups(self):
543
535
format = bzrdir.BzrDirMetaFormat1()