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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        wt = self.make_branch_and_tree('a', format='rich-root-pack')
29
29
        wt.add(['b', 'b/c', 'd'], [b'b-id', b'c-id', b'd-id'])
30
30
        wt.commit('added files')
31
 
        b_wt = wt.extract('b', b'b-id')
 
31
        b_wt = wt.extract('b')
32
32
        self.assertEqual(b'b-id', b_wt.get_root_id())
33
33
        self.assertEqual(b'c-id', b_wt.path2id('c'))
34
34
        self.assertEqual('c', b_wt.id2path(b'c-id'))
43
43
        wt = a_branch.create_checkout('a', lightweight=True)
44
44
        wt.add(['b', 'b/c', 'b/c/d'], [b'b-id', b'c-id', b'd-id'])
45
45
        wt.commit('added files')
46
 
        return wt.extract('b', b'b-id')
 
46
        return wt.extract('b')
47
47
 
48
48
    def test_extract_in_checkout(self):
49
49
        a_branch = self.make_branch('branch', format='rich-root-pack')
57
57
        self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d/', 'a/b/c/d/e'])
58
58
        wt = a_branch.create_checkout('a', lightweight=True)
59
59
        wt.add(['b', 'b/c', 'b/c/d', 'b/c/d/e/'], [b'b-id', b'c-id', b'd-id',
60
 
                b'e-id'])
 
60
                                                   b'e-id'])
61
61
        wt.commit('added files')
62
 
        b_wt = wt.extract('b/c/d', b'd-id')
 
62
        b_wt = wt.extract('b/c/d')
63
63
        b_branch = branch.Branch.open('branch/b/c/d')
64
64
        b_branch_ref = branch.Branch.open('a/b/c/d')
65
65
        self.assertEqual(b_branch.base, b_branch_ref.base)
73
73
 
74
74
    def test_good_repo_format(self):
75
75
        repo = self.make_repository('branch', shared=True,
76
 
            format='dirstate-with-subtree')
 
76
                                    format='dirstate-with-subtree')
77
77
        a_branch = repo.controldir.create_branch()
78
78
        wt_b = self.extract_in_checkout(a_branch)
79
79
        self.assertEqual(wt_b.branch.repository.controldir.transport.base,
80
 
        repo.controldir.transport.base)
 
80
                         repo.controldir.transport.base)