/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_branch.py

Merge tree reference fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
        self.assertPathDoesNotExist('a/.bzr/branch/bound')
328
328
        self.assertEqual('ftp://example.com', branch.get_bound_location())
329
329
 
330
 
    def do_checkout_test(self, lightweight=False):
 
330
    def do_checkout_test(self, lightweight):
331
331
        tree = self.make_branch_and_tree('source',
332
332
                                         format=self.get_format_name_subtree())
333
333
        subtree = self.make_branch_and_tree('source/subtree',
339
339
        subsubtree.add('file')
340
340
        subtree.add('file')
341
341
        subtree.add_reference(subsubtree)
 
342
        subtree.set_reference_info('subsubtree', subsubtree.branch.user_url)
342
343
        tree.add_reference(subtree)
 
344
        tree.set_reference_info('subtree', subtree.branch.user_url)
343
345
        tree.commit('a revision')
344
346
        subtree.commit('a subtree file')
345
347
        subsubtree.commit('a subsubtree file')
355
357
            self.assertEndsWith(subbranch.base, 'target/subtree/subsubtree/')
356
358
 
357
359
    def test_checkout_with_references(self):
358
 
        self.do_checkout_test()
 
360
        self.do_checkout_test(lightweight=False)
359
361
 
360
362
    def test_light_checkout_with_references(self):
361
363
        self.do_checkout_test(lightweight=True)
489
491
    def test_reference_info_caches_cleared(self):
490
492
        branch = self.make_branch('branch')
491
493
        with branch.lock_write():
492
 
            branch.set_reference_info('path2', 'location2', b'file-id')
 
494
            branch.set_reference_info(b'file-id', 'location2', 'path2')
493
495
        doppelganger = _mod_branch.Branch.open('branch')
494
 
        doppelganger.set_reference_info('path3', 'location3', b'file-id')
495
 
        self.assertEqual(('location3', b'file-id'),
496
 
                         branch.get_reference_info('path3'))
 
496
        doppelganger.set_reference_info(b'file-id', 'location3', 'path3')
 
497
        self.assertEqual(('location3', 'path3'),
 
498
                         branch.get_reference_info(b'file-id'))
497
499
 
498
500
    def _recordParentMapCalls(self, repo):
499
501
        self._parent_map_calls = []