/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

Update a clean branch with the dirstate improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
        tt.apply()
165
165
        return self._convert_tree(tree, converter)
166
166
 
 
167
    def get_tree_with_subdirs_and_all_content_types(self):
 
168
        """Return a test tree with subdirs and all content types.
 
169
 
 
170
        The returned tree has the following inventory:
 
171
            [('', inventory.ROOT_ID),
 
172
             ('0file', '2file'),
 
173
             ('1top-dir', '1top-dir'),
 
174
             (u'2utf\u1234file', u'0utf\u1234file'),
 
175
             ('symlink', 'symlink'),
 
176
             ('1top-dir/0file-in-1topdir', '1file-in-1topdir'),
 
177
             ('1top-dir/1dir-in-1topdir', '0dir-in-1topdir')]
 
178
        where each component has the type of its name - i.e. '1file..' is afile.
 
179
 
 
180
        note that the order of the paths and fileids is deliberately 
 
181
        mismatched to ensure that the result order is path based.
 
182
        """
 
183
        tree = self.make_branch_and_tree('.')
 
184
        paths = ['0file',
 
185
            '1top-dir/',
 
186
            u'2utf\u1234file',
 
187
            '1top-dir/0file-in-1topdir',
 
188
            '1top-dir/1dir-in-1topdir/'
 
189
            ]
 
190
        ids = [
 
191
            '2file',
 
192
            '1top-dir',
 
193
            u'0utf\u1234file',
 
194
            '1file-in-1topdir',
 
195
            '0dir-in-1topdir'
 
196
            ]
 
197
        self.build_tree(paths)
 
198
        tree.add(paths, ids)
 
199
        tt = transform.TreeTransform(tree)
 
200
        root_transaction_id = tt.trans_id_tree_path('')
 
201
        tt.new_symlink('symlink',
 
202
            root_transaction_id, 'link-target', 'symlink')
 
203
        tt.apply()
 
204
        return self.workingtree_to_test_tree(tree)
 
205
 
167
206
 
168
207
class TreeTestProviderAdapter(WorkingTreeTestProviderAdapter):
169
208
    """Generate test suites for each Tree implementation in bzrlib.
191
230
def test_suite():
192
231
    result = TestSuite()
193
232
    test_tree_implementations = [
 
233
        'bzrlib.tests.tree_implementations.test_revision_tree',
194
234
        'bzrlib.tests.tree_implementations.test_test_trees',
195
235
        'bzrlib.tests.tree_implementations.test_tree',
 
236
        'bzrlib.tests.tree_implementations.test_walkdirs',
196
237
        ]
197
238
    adapter = TreeTestProviderAdapter(
198
239
        default_transport,