/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_subsume.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        sub_tree = self.make_branch_and_tree('tree/subtree',
37
37
                                             format='development-subtree')
38
38
        if same_root is True:
39
 
            sub_tree.set_root_id(base_tree.path2id(''))
 
39
            sub_tree.set_root_id(base_tree.get_root_id())
40
40
        sub_tree.add('file2', b'file2-id')
41
41
        sub_tree.commit('first commit', rev_id=b'subtree-1')
42
42
        return base_tree, sub_tree
59
59
 
60
60
    def test_subsume_tree(self):
61
61
        base_tree, sub_tree = self.make_trees()
62
 
        self.assertNotEqual(base_tree.path2id(''), sub_tree.path2id(''))
63
 
        sub_root_id = sub_tree.path2id('')
 
62
        self.assertNotEqual(base_tree.get_root_id(), sub_tree.get_root_id())
 
63
        sub_root_id = sub_tree.get_root_id()
64
64
        # this test checks the subdir is removed, so it needs to know the
65
65
        # control directory; that changes rarely so just hardcode (and check)
66
66
        # it is correct.
77
77
        base_tree = workingtree.WorkingTree.open('tree')
78
78
        base_tree.commit('combined', rev_id=b'combined-1')
79
79
        self.assertEqual(b'file2-id', base_tree.path2id('subtree/file2'))
80
 
        if base_tree.supports_setting_file_ids():
81
 
            self.assertEqual('subtree/file2', base_tree.id2path(b'file2-id'))
 
80
        self.assertEqual('subtree/file2', base_tree.id2path(b'file2-id'))
82
81
        self.assertEqualDiff(file2_contents,
83
82
                             base_tree.get_file_text('subtree/file2'))
84
83
        basis_tree = base_tree.basis_tree()
95
94
 
96
95
    def test_subsume_failure(self):
97
96
        base_tree, sub_tree = self.make_trees()
98
 
        if base_tree.path2id('') == sub_tree.path2id(''):
 
97
        if base_tree.get_root_id() == sub_tree.get_root_id():
99
98
            raise tests.TestSkipped('This test requires unique roots')
100
99
        self.assertRaises(errors.BadSubsumeSource, base_tree.subsume,
101
100
                          base_tree)