/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/blackbox/test_reference.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-01-19 04:16:09 UTC
  • mfrom: (7447.4.2 reference-info-file-id)
  • Revision ID: breezy.the.bot@gmail.com-20200119041609-3lik1tsdsln5stab
Store bzr reference information by file id rather than by path.

Merged from https://code.launchpad.net/~jelmer/brz/reference-info-file-id/+merge/377801

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    def test_no_args_lists(self):
33
33
        tree = self.make_branch_and_tree('branch')
34
34
        branch = tree.branch
35
 
        branch.set_reference_info('path', 'http://example.org')
36
35
        tree.add_reference(self.make_branch_and_tree('branch/path'))
37
36
        tree.add_reference(self.make_branch_and_tree('branch/lath'))
38
 
        branch.set_reference_info('lath', 'http://example.org/2')
 
37
        tree.set_reference_info('path', 'http://example.org')
 
38
        tree.set_reference_info('lath', 'http://example.org/2')
39
39
        out, err = self.run_bzr('reference', working_dir='branch')
40
40
        lines = out.splitlines()
41
41
        self.assertEqual('lath http://example.org/2', lines[0])
45
45
        tree = self.make_branch_and_tree('tree')
46
46
        subtree = self.make_branch_and_tree('tree/newpath')
47
47
        tree.add_reference(subtree)
 
48
        tree.set_reference_info('newpath', 'http://example.org')
48
49
        tree.commit('add reference')
49
 
        tree.set_reference_info('newpath', 'http://example.org')
50
 
        tree.set_reference_info('lath', 'http://example.org/2')
51
50
        return tree
52
51
 
53
52
    def test_uses_working_tree_location(self):
57
56
 
58
57
    def test_uses_basis_tree_location(self):
59
58
        tree = self.make_tree_with_reference()
60
 
        tree.commit('add newpath')
61
59
        tree.controldir.destroy_workingtree()
62
60
        out, err = self.run_bzr('reference', working_dir='tree')
63
61
        self.assertContainsRe(out, 'newpath http://example.org\n')
90
88
 
91
89
    def test_missing_file_forced(self):
92
90
        tree = self.make_branch_and_tree('tree')
 
91
        tree.add_reference(self.make_branch_and_tree('tree/file'))
93
92
        out, err = self.run_bzr(
94
93
            'reference --force-unversioned file http://example.org',
95
94
            working_dir='tree')
96
 
        location, file_id = tree.branch.get_reference_info('file')
 
95
        location = tree.get_reference_info('file')
97
96
        self.assertEqual('http://example.org', location)
98
97
        self.assertEqual('', out)
99
98
        self.assertEqual('', err)