1599
1599
return template % ('<' * 7, tree, '=' * 7, merge, '>' * 7)
1602
class TestInventoryAltered(tests.TestCaseWithTransport):
1604
def test_inventory_altered_unchanged(self):
1605
tree = self.make_branch_and_tree('tree')
1606
self.build_tree(['tree/foo'])
1607
tree.add('foo', 'foo-id')
1608
with TransformPreview(tree) as tt:
1609
self.assertEqual([], tt._inventory_altered())
1611
def test_inventory_altered_changed_parent_id(self):
1612
tree = self.make_branch_and_tree('tree')
1613
self.build_tree(['tree/foo'])
1614
tree.add('foo', 'foo-id')
1615
with TransformPreview(tree) as tt:
1616
tt.unversion_file(tt.root)
1617
tt.version_file('new-id', tt.root)
1618
foo_trans_id = tt.trans_id_tree_file_id('foo-id')
1619
foo_tuple = ('foo', foo_trans_id)
1620
root_tuple = ('', tt.root)
1621
self.assertEqual([root_tuple, foo_tuple], tt._inventory_altered())
1623
def test_inventory_altered_noop_changed_parent_id(self):
1624
tree = self.make_branch_and_tree('tree')
1625
self.build_tree(['tree/foo'])
1626
tree.add('foo', 'foo-id')
1627
with TransformPreview(tree) as tt:
1628
tt.unversion_file(tt.root)
1629
tt.version_file(tree.get_root_id(), tt.root)
1630
foo_trans_id = tt.trans_id_tree_file_id('foo-id')
1631
self.assertEqual([], tt._inventory_altered())
1602
1634
class TestTransformMerge(TestCaseInTempDir):
1604
1636
def test_text_merge(self):