~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-10 16:19:57 UTC
  • mfrom: (5954.2.7 merge-into-empty-fixups)
  • Revision ID: pqm@pqm.ubuntu.com-20110610161957-hh5ni839m7r3wsan
Cleanups and fixes for merging into null tree. (Aaron Bentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1599
1599
    return template % ('<' * 7, tree, '=' * 7, merge, '>' * 7)
1600
1600
 
1601
1601
 
 
1602
class TestInventoryAltered(tests.TestCaseWithTransport):
 
1603
 
 
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())
 
1610
 
 
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())
 
1622
 
 
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())
 
1632
 
 
1633
 
1602
1634
class TestTransformMerge(TestCaseInTempDir):
1603
1635
 
1604
1636
    def test_text_merge(self):