261
261
def assertDeltaApplicationResultsInExpectedBasis(self, tree, revid, delta,
262
262
expected_inventory):
263
tree.update_basis_by_delta(revid, delta)
265
tree.update_basis_by_delta(revid, delta)
264
268
# check the last revision was adjusted to rev_id
265
269
self.assertEqual(revid, tree.last_revision())
266
270
# check the parents are what we expect
354
358
parents.append(extra_parent)
355
359
tree.set_parent_ids(parents)
356
360
self.fake_up_revision(tree, new_revid, new_shape)
361
# give tree an inventory of new_shape
362
tree._write_inventory(new_shape)
357
363
self.assertDeltaApplicationResultsInExpectedBasis(tree, new_revid,
358
364
delta, new_shape)
359
365
osutils.rmtree('tree')
575
581
self.add_link(new_shape, new_revid, 'link-id-B', 'root-id', 'B', 'C')
576
582
self.assertTransitionFromBasisToShape(basis_shape, old_revid,
577
583
new_shape, new_revid)
585
def test_move_moves_children_recursively(self):
586
old_revid = 'old-parent'
587
basis_shape = Inventory(root_id=None)
588
self.add_dir(basis_shape, old_revid, 'root-id', None, '')
589
self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
590
self.add_dir(basis_shape, old_revid, 'dir-id-B', 'dir-id-A', 'B')
591
self.add_link(basis_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'D')
592
new_revid = 'new-parent'
593
new_shape = Inventory(root_id=None)
594
self.add_new_root(new_shape, old_revid, new_revid)
596
self.add_dir(new_shape, new_revid, 'dir-id-A', 'root-id', 'B')
598
self.add_dir(new_shape, old_revid, 'dir-id-B', 'dir-id-A', 'B')
599
self.add_link(new_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'D')
600
self.assertTransitionFromBasisToShape(basis_shape, old_revid,
601
new_shape, new_revid)