/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

  • 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:
22
22
also see this file.
23
23
"""
24
24
 
25
 
from io import StringIO
26
 
 
27
25
from .. import (
28
 
    bedding,
29
26
    branch as _mod_branch,
30
27
    config,
31
28
    controldir,
42
39
    BzrBranch5,
43
40
    BzrBranchFormat5,
44
41
    )
 
42
from ..sixish import (
 
43
    StringIO,
 
44
    )
45
45
 
46
46
 
47
47
class TestErrors(tests.TestCase):
117
117
                             b"push_location = foo\n"
118
118
                             b"push_location:policy = norecurse\n" % local_path.encode(
119
119
                                 'utf-8'),
120
 
                             bedding.locations_config_path())
 
120
                             config.locations_config_filename())
121
121
 
122
122
    # TODO RBC 20051029 test getting a push location from a branch in a
123
123
    # recursive section - that is, it appends the branch name.
326
326
        self.assertPathDoesNotExist('a/.bzr/branch/bound')
327
327
        self.assertEqual('ftp://example.com', branch.get_bound_location())
328
328
 
329
 
    def do_checkout_test(self, lightweight):
 
329
    def do_checkout_test(self, lightweight=False):
330
330
        tree = self.make_branch_and_tree('source',
331
331
                                         format=self.get_format_name_subtree())
332
332
        subtree = self.make_branch_and_tree('source/subtree',
338
338
        subsubtree.add('file')
339
339
        subtree.add('file')
340
340
        subtree.add_reference(subsubtree)
341
 
        subtree.set_reference_info('subsubtree', subsubtree.branch.user_url)
342
341
        tree.add_reference(subtree)
343
 
        tree.set_reference_info('subtree', subtree.branch.user_url)
344
342
        tree.commit('a revision')
345
343
        subtree.commit('a subtree file')
346
344
        subsubtree.commit('a subsubtree file')
356
354
            self.assertEndsWith(subbranch.base, 'target/subtree/subsubtree/')
357
355
 
358
356
    def test_checkout_with_references(self):
359
 
        self.do_checkout_test(lightweight=False)
 
357
        self.do_checkout_test()
360
358
 
361
359
    def test_light_checkout_with_references(self):
362
360
        self.do_checkout_test(lightweight=True)
490
488
    def test_reference_info_caches_cleared(self):
491
489
        branch = self.make_branch('branch')
492
490
        with branch.lock_write():
493
 
            branch.set_reference_info(b'file-id', 'location2', 'path2')
 
491
            branch.set_reference_info('path2', 'location2', b'file-id')
494
492
        doppelganger = _mod_branch.Branch.open('branch')
495
 
        doppelganger.set_reference_info(b'file-id', 'location3', 'path3')
496
 
        self.assertEqual(('location3', 'path3'),
497
 
                         branch.get_reference_info(b'file-id'))
 
493
        doppelganger.set_reference_info('path3', 'location3', b'file-id')
 
494
        self.assertEqual(('location3', b'file-id'),
 
495
                         branch.get_reference_info('path3'))
498
496
 
499
497
    def _recordParentMapCalls(self, repo):
500
498
        self._parent_map_calls = []