196
196
self.assertRaises(errors.UnknownBuildAction,
197
197
builder.build_snapshot, 'B-id', None, [('weirdo', ('foo',))])
199
# TODO: rename a file/directory, but rename isn't supported by the
200
# MemoryTree api yet, so for now we wait until it is used
199
def test_rename(self):
200
builder = self.build_a_rev()
201
builder.build_snapshot('B-id', None,
202
[('rename', ('a', 'b'))])
203
rev_tree = builder.get_branch().repository.revision_tree('B-id')
204
self.assertTreeShape([(u'', 'a-root-id', 'directory'),
205
(u'b', 'a-id', 'file')], rev_tree)
207
def test_rename_into_subdir(self):
208
builder = self.build_a_rev()
209
builder.build_snapshot('B-id', None,
210
[('add', ('dir', 'dir-id', 'directory', None)),
211
('rename', ('a', 'dir/a'))])
212
rev_tree = builder.get_branch().repository.revision_tree('B-id')
213
self.assertTreeShape([(u'', 'a-root-id', 'directory'),
214
(u'dir', 'dir-id', 'directory'),
215
(u'dir/a', 'a-id', 'file')], rev_tree)
202
217
def test_set_parent(self):
203
218
builder = self.build_a_rev()