/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/per_tree/test_inv.py

  • Committer: Jelmer Vernooij
  • Date: 2017-08-01 01:44:41 UTC
  • mto: This revision was merged to the branch mainline in revision 6746.
  • Revision ID: jelmer@jelmer.uk-20170801014441-hnh9tdmil2o3vqek
Avoid explicitly setting file ids or guard it by checking
WorkingTree.supports_setting_file_ids() and skipping if it's not set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    def test_paths2ids_recursive(self):
75
75
        work_tree = self.make_branch_and_tree('tree')
76
76
        self.build_tree(['tree/dir/', 'tree/dir/file'])
77
 
        work_tree.add(['dir', 'dir/file'], ['dir-id', 'file-id'])
 
77
        work_tree.add(['dir', 'dir/file'])
78
78
        tree = self._convert_tree(work_tree)
79
79
        tree.lock_read()
80
80
        self.addCleanup(tree.unlock)
81
 
        self.assertEqual({'dir-id', 'file-id'}, tree.paths2ids(['dir']))
 
81
        self.assertEqual({tree.path2id('dir'), tree.path2id('dir/file')},
 
82
                         tree.paths2ids(['dir']))
82
83
 
83
84
    def test_paths2ids_forget_old(self):
84
85
        work_tree = self.make_branch_and_tree('tree')
85
86
        self.build_tree(['tree/file'])
86
 
        work_tree.add('file', 'first-id')
 
87
        work_tree.add('file')
87
88
        work_tree.commit('commit old state')
88
89
        work_tree.remove('file')
89
90
        tree = self._convert_tree(work_tree)
114
115
    def test_canonical_path_before_commit(self):
115
116
        work_tree = self._make_canonical_test_tree(False)
116
117
        if not isinstance(work_tree, InventoryTree):
 
118
            # note: not committed.
117
119
            raise tests.TestNotApplicable(
118
 
                "test not applicable on non-inventory tests")        # note: not committed.
 
120
                "test not applicable on non-inventory tests")
119
121
        self.assertEqual('dir/file',
120
122
                         work_tree.get_canonical_inventory_path('Dir/File'))
121
123