~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-04 22:23:20 UTC
  • mfrom: (5825 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5830.
  • Revision ID: jelmer@samba.org-20110504222320-bczsppms2wadcrb4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    TreeDirectory,
42
42
    TreeFile,
43
43
    TreeLink,
 
44
    InventoryWorkingTree,
44
45
    WorkingTree,
45
46
    )
46
47
from bzrlib.conflicts import ConflictList, TextConflict, ContentsConflict
244
245
        revid = b.revision_history()[0]
245
246
        self.log('first revision_id is {%s}' % revid)
246
247
 
247
 
        inv = b.repository.get_inventory(revid)
248
 
        self.log('contents of inventory: %r' % inv.entries())
 
248
        tree = b.repository.revision_tree(revid)
 
249
        self.log('contents of tree: %r' % list(tree.iter_entries_by_dir()))
249
250
 
250
 
        self.check_inventory_shape(inv,
251
 
                                   ['dir/', 'dir/sub/', 'dir/sub/file'])
 
251
        self.check_tree_shape(tree, ['dir/', 'dir/sub/', 'dir/sub/file'])
252
252
        wt.rename_one('dir', 'newdir')
253
253
 
254
254
        wt.lock_read()
255
 
        self.check_inventory_shape(wt.inventory,
 
255
        self.check_tree_shape(wt,
256
256
                                   ['newdir/', 'newdir/sub/', 'newdir/sub/file'])
257
257
        wt.unlock()
258
258
        wt.rename_one('newdir/sub', 'newdir/newsub')
259
259
        wt.lock_read()
260
 
        self.check_inventory_shape(wt.inventory,
261
 
                                   ['newdir/', 'newdir/newsub/',
 
260
        self.check_tree_shape(wt, ['newdir/', 'newdir/newsub/',
262
261
                                    'newdir/newsub/file'])
263
262
        wt.unlock()
264
263
 
775
774
            tree.lock_read()
776
775
            self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
777
776
                    [(path, ie.kind) for path,ie in
778
 
                                tree.inventory.iter_entries()])
 
777
                                tree.iter_entries_by_dir()])
779
778
            tree.unlock()
780
779
        finally:
781
780
            osutils.normalized_filename = orig
797
796
    def test__write_inventory(self):
798
797
        # The private interface _write_inventory is currently used by transform.
799
798
        tree = self.make_branch_and_tree('.')
 
799
        if not isinstance(tree, InventoryWorkingTree):
 
800
            raise TestNotApplicable("_write_inventory does not exist on "
 
801
                "non-inventory working trees")
800
802
        # if we write write an inventory then do a walkdirs we should get back
801
803
        # missing entries, and actual, and unknowns as appropriate.
802
804
        self.build_tree(['present', 'unknown'])