~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_inv.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-20 17:41:09 UTC
  • mfrom: (3363.12.9 paths2ids)
  • Revision ID: pqm@pqm.ubuntu.com-20080920174109-rrml3htu12o56j1h
Support path2ids better for PreviewTree

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        entry = get_entry(self.tree, self.tree.path2id('symlink'))
104
104
        self.assertEqual(entry.kind, 'symlink')
105
105
        self.assertEqual(None, entry.text_size)
 
106
 
 
107
    def test_paths2ids_recursive(self):
 
108
        work_tree = self.make_branch_and_tree('tree')
 
109
        self.build_tree(['tree/dir/', 'tree/dir/file'])
 
110
        work_tree.add(['dir', 'dir/file'], ['dir-id', 'file-id'])
 
111
        tree = self._convert_tree(work_tree)
 
112
        tree.lock_read()
 
113
        self.addCleanup(tree.unlock)
 
114
        self.assertEqual(set(['dir-id', 'file-id']), tree.paths2ids(['dir']))
 
115
 
 
116
    def test_paths2ids_forget_old(self):
 
117
        work_tree = self.make_branch_and_tree('tree')
 
118
        self.build_tree(['tree/file'])
 
119
        work_tree.add('file', 'first-id')
 
120
        work_tree.commit('commit old state')
 
121
        work_tree.remove('file')
 
122
        tree = self._convert_tree(work_tree)
 
123
        tree.lock_read()
 
124
        self.addCleanup(tree.unlock)
 
125
        self.assertEqual(set([]), tree.paths2ids(['file'],
 
126
                         require_versioned=False))