/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/tree_implementations/__init__.py

  • Committer: Robert Collins
  • Date: 2006-07-28 09:00:47 UTC
  • mto: (1852.14.2 status-benchmarks)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: robertc@robertcollins.net-20060728090047-d58a4d7c12eee48e
Add a complex test tree for use with Tree.walkdirs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        tt.apply()
158
158
        return self.workingtree_to_test_tree(tree)
159
159
 
 
160
    def get_tree_with_subdirs_and_all_content_types(self):
 
161
        """Return a test tree with subdirs and all content types.
 
162
 
 
163
        The returned tree has the following inventory:
 
164
            [('', inventory.ROOT_ID),
 
165
             ('0file', '2file'),
 
166
             ('1top-dir', '1top-dir'),
 
167
             (u'2utf\u1234file', u'0utf\u1234file'),
 
168
             ('symlink', 'symlink'),
 
169
             ('1top-dir/0file-in-1topdir', '1file-in-1topdir'),
 
170
             ('1top-dir/1dir-in-1topdir', '0dir-in-1topdir')]
 
171
        where each component has the type of its name - i.e. '1file..' is afile.
 
172
 
 
173
        note that the order of the paths and fileids is deliberately 
 
174
        mismatched to ensure that the result order is path based.
 
175
        """
 
176
        tree = self.make_branch_and_tree('.')
 
177
        paths = ['0file',
 
178
            '1top-dir/',
 
179
            u'2utf\u1234file',
 
180
            '1top-dir/0file-in-1topdir',
 
181
            '1top-dir/1dir-in-1topdir/'
 
182
            ]
 
183
        ids = [
 
184
            '2file',
 
185
            '1top-dir',
 
186
            u'0utf\u1234file',
 
187
            '1file-in-1topdir',
 
188
            '0dir-in-1topdir'
 
189
            ]
 
190
        self.build_tree(paths)
 
191
        tree.add(paths, ids)
 
192
        tt = transform.TreeTransform(tree)
 
193
        root_transaction_id = tt.trans_id_tree_path('')
 
194
        tt.new_symlink('symlink',
 
195
            root_transaction_id, 'link-target', 'symlink')
 
196
        tt.apply()
 
197
        return self.workingtree_to_test_tree(tree)
 
198
 
160
199
 
161
200
class TreeTestProviderAdapter(WorkingTreeTestProviderAdapter):
162
201
    """Generate test suites for each Tree implementation in bzrlib.