/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: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

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.get_root_id())
 
39
            sub_tree.set_root_id(base_tree.path2id(''))
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.get_root_id(), sub_tree.get_root_id())
63
 
        sub_root_id = sub_tree.get_root_id()
 
62
        self.assertNotEqual(base_tree.path2id(''), sub_tree.path2id(''))
 
63
        sub_root_id = sub_tree.path2id('')
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
 
        self.assertEqual('subtree/file2', base_tree.id2path(b'file2-id'))
 
80
        if base_tree.supports_setting_file_ids():
 
81
            self.assertEqual('subtree/file2', base_tree.id2path(b'file2-id'))
81
82
        self.assertEqualDiff(file2_contents,
82
83
                             base_tree.get_file_text('subtree/file2'))
83
84
        basis_tree = base_tree.basis_tree()
94
95
 
95
96
    def test_subsume_failure(self):
96
97
        base_tree, sub_tree = self.make_trees()
97
 
        if base_tree.get_root_id() == sub_tree.get_root_id():
 
98
        if base_tree.path2id('') == sub_tree.path2id(''):
98
99
            raise tests.TestSkipped('This test requires unique roots')
99
100
        self.assertRaises(errors.BadSubsumeSource, base_tree.subsume,
100
101
                          base_tree)