/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/tests/workingtree_implementations/test_set_root_id.py

New method ``WorkingTree.flush()`` which will write the current memory
inventory out to disk. At the same time, read_working_inventory will
no longer trash the current tree inventory if it has been modified within
the current lock, and the tree will now ``flush()`` automatically on
``unlock()``. ``WorkingTree.set_root_id()`` has been updated to take
advantage of this functionality. (Robert Collins, John Arbash Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        # setting the root id allows it to be read via get_root_id.
39
39
        tree.lock_write()
40
40
        try:
 
41
            old_id = tree.get_root_id()
41
42
            tree.set_root_id(u'\xe5n id')
42
43
            self.assertEqual(u'\xe5n id', tree.get_root_id())
 
44
            # set root id should not have triggered a flush of the tree,
 
45
            # so check a new tree sees the old state.
 
46
            reference_tree = tree.bzrdir.open_workingtree()
 
47
            self.assertEqual(old_id, reference_tree.get_root_id())
43
48
        finally:
44
49
            tree.unlock()
45
50
        # having unlocked the tree, the value should have been