~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_memorytree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-04-07 07:52:50 UTC
  • mfrom: (3340.1.1 208418-1.4)
  • Revision ID: pqm@pqm.ubuntu.com-20080407075250-phs53xnslo8boaeo
Return the correct knit serialisation method in _StreamAccess.
        (Andrew Bennetts, Martin Pool, Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            tree.get_file(tree.path2id('foo')).read())
53
53
        tree.unlock()
54
54
 
 
55
    def test_get_root_id(self):
 
56
        branch = self.make_branch('branch')
 
57
        tree = MemoryTree.create_on_branch(branch)
 
58
        tree.lock_write()
 
59
        try:
 
60
            tree.add([''])
 
61
            self.assertIsNot(None, tree.get_root_id())
 
62
        finally:
 
63
            tree.unlock()
 
64
 
55
65
    def test_lock_tree_write(self):
56
66
        """Check we can lock_tree_write and unlock MemoryTrees."""
57
67
        branch = self.make_branch('branch')
133
143
        tree.unlock()
134
144
        # and we should have a revision that is accessible outside the tree lock
135
145
        revtree = tree.branch.repository.revision_tree(revision_id)
 
146
        revtree.lock_read()
 
147
        self.addCleanup(revtree.unlock)
136
148
        self.assertEqual('barshoom', revtree.get_file('foo-id').read())
137
149
 
138
150
    def test_unversion(self):