~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree_4.py

  • Committer: Martin Pool
  • Date: 2010-04-01 04:41:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5128.
  • Revision ID: mbp@sourcefrog.net-20100401044118-shyctqc02ob08ngz
ignore .testrepository

Show diffs side-by-side

added added

removed removed

Lines of Context:
757
757
            ('', [(('', 'dir', 'dir-id'), ['d', 'd'])]),
758
758
            ('dir', [(('dir', 'file', 'file-id'), ['a', 'f'])]),
759
759
        ],  self.get_simple_dirblocks(state))
760
 
 
761
 
 
762
 
class TestInventoryCoherency(TestCaseWithTransport):
763
 
 
764
 
    def test_inventory_is_synced_when_unversioning_a_dir(self):
765
 
        """Unversioning the root of a subtree unversions the entire subtree."""
766
 
        tree = self.make_branch_and_tree('.')
767
 
        self.build_tree(['a/', 'a/b', 'c/'])
768
 
        tree.add(['a', 'a/b', 'c'], ['a-id', 'b-id', 'c-id'])
769
 
        # within a lock unversion should take effect
770
 
        tree.lock_write()
771
 
        self.addCleanup(tree.unlock)
772
 
        # Force access to the in memory inventory to trigger bug #494221: try
773
 
        # maintaining the in-memory inventory
774
 
        inv = tree.inventory
775
 
        self.assertTrue(inv.has_id('a-id'))
776
 
        self.assertTrue(inv.has_id('b-id'))
777
 
        tree.unversion(['a-id', 'b-id'])
778
 
        self.assertFalse(inv.has_id('a-id'))
779
 
        self.assertFalse(inv.has_id('b-id'))