181
181
def get_tree_with_subdirs_and_all_content_types(self):
182
182
"""Return a test tree with subdirs and all content types.
183
See get_tree_with_subdirs_and_all_supported_content_types for details.
185
return self.get_tree_with_subdirs_and_all_supported_content_types(True)
187
def get_tree_with_subdirs_and_all_supported_content_types(self, symlinks):
188
"""Return a test tree with subdirs and all supported content types.
189
Some content types may not be created on some platforms
190
(like symlinks on native win32)
192
:param symlinks: control is symlink should be created in the tree.
193
Note: if you wish to automatically set this
194
parameters depending on underlying system,
195
please use value returned
196
by bzrlib.osutils.has_symlinks() function.
184
198
The returned tree has the following inventory:
185
199
[('', inventory.ROOT_ID),
186
200
('0file', '2file'),
187
201
('1top-dir', '1top-dir'),
188
202
(u'2utf\u1234file', u'0utf\u1234file'),
189
('symlink', 'symlink'),
203
('symlink', 'symlink'), # only if symlinks arg is True
190
204
('1top-dir/0file-in-1topdir', '1file-in-1topdir'),
191
205
('1top-dir/1dir-in-1topdir', '0dir-in-1topdir')]
192
where each component has the type of its name - i.e. '1file..' is afile.
206
where each component has the type of its name -
207
i.e. '1file..' is afile.
194
209
note that the order of the paths and fileids is deliberately
195
210
mismatched to ensure that the result order is path based.
215
230
'This platform does not support unicode file paths.')
216
231
tree.add(paths, ids)
217
232
tt = transform.TreeTransform(tree)
218
root_transaction_id = tt.trans_id_tree_path('')
219
tt.new_symlink('symlink',
220
root_transaction_id, 'link-target', 'symlink')
234
root_transaction_id = tt.trans_id_tree_path('')
235
tt.new_symlink('symlink',
236
root_transaction_id, 'link-target', 'symlink')
222
238
return self.workingtree_to_test_tree(tree)