/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: 2018-05-04 15:41:16 UTC
  • mfrom: (6926.2.17 tree-reference-fixes)
  • Revision ID: breezy.the.bot@gmail.com-20180504154116-wcevgfi1gl5nfbdc
Several changes to help foreign branch use of tree references.

Merged from https://code.launchpad.net/~jelmer/brz/tree-reference-fixes/+merge/342059

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
    def test_no_args_lists(self):
35
35
        branch = self.make_branch('branch')
36
 
        branch.set_reference_info('file-id', 'path', 'http://example.org')
37
 
        branch.set_reference_info('file-id2', 'lath', 'http://example.org/2')
 
36
        branch.set_reference_info('path', 'http://example.org', b'file-id')
 
37
        branch.set_reference_info('lath', 'http://example.org/2', b'file-id2')
38
38
        out, err = self.run_bzr('reference', working_dir='branch')
39
39
        lines = out.splitlines()
40
40
        self.assertEqual('lath http://example.org/2', lines[0])
44
44
        tree = self.make_branch_and_tree('tree')
45
45
        self.build_tree(['tree/newpath'])
46
46
        tree.add('newpath', b'file-id')
47
 
        tree.branch.set_reference_info('file-id', 'path', 'http://example.org')
48
 
        tree.branch.set_reference_info('file-id2', 'lath',
49
 
                                       'http://example.org/2')
 
47
        tree.branch.set_reference_info('newpath', 'http://example.org', b'file-id')
 
48
        tree.branch.set_reference_info('lath', 'http://example.org/2',
 
49
                b'file-id2')
50
50
        return tree
51
51
 
52
52
    def test_uses_working_tree_location(self):
76
76
        self.build_tree(['tree/file'])
77
77
        tree.add('file', b'file-id')
78
78
        out, err = self.run_bzr('reference tree/file http://example.org')
79
 
        path, location = tree.branch.get_reference_info('file-id')
 
79
        location, file_id = tree.branch.get_reference_info('file')
80
80
        self.assertEqual('http://example.org', location)
81
 
        self.assertEqual('file', path)
 
81
        self.assertEqual(b'file-id', file_id)
82
82
        self.assertEqual('', out)
83
83
        self.assertEqual('', err)
84
84