~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: Robert Collins
  • Date: 2006-02-21 11:42:36 UTC
  • mfrom: (1534.1.36 inter-repo-api)
  • mto: This revision was merged to the branch mainline in revision 1560.
  • Revision ID: robertc@robertcollins.net-20060221114236-0deb1948f0c8c956
Merge in InterRepository API support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
122
122
    
123
123
    def test_clone_bzrdir_repository(self):
 
124
        tree = self.make_branch_and_tree('commit_tree')
 
125
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
 
126
        tree.add('foo')
 
127
        tree.commit('revision 1', rev_id='1')
124
128
        dir = self.make_bzrdir('source')
125
129
        repo = dir.create_repository()
126
 
        # add some content to differentiate from an empty repository.
127
 
        repo.control_weaves.add_text('inventory',
128
 
                                     "A",
129
 
                                     [],
130
 
                                     [],
131
 
                                     repo.get_transaction())
 
130
        repo.fetch(tree.branch.repository)
 
131
        self.assertTrue(repo.has_revision('1'))
132
132
        target = dir.clone(self.get_url('target'))
133
133
        self.assertNotEqual(dir.transport.base, target.transport.base)
134
134
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
135
135
 
136
136
    def test_clone_bzrdir_repository_under_shared(self):
 
137
        tree = self.make_branch_and_tree('commit_tree')
 
138
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
 
139
        tree.add('foo')
 
140
        tree.commit('revision 1', rev_id='1')
137
141
        dir = self.make_bzrdir('source')
138
142
        repo = dir.create_repository()
139
 
        # add some content to differentiate from an empty repository.
140
 
        repo.control_weaves.add_text('inventory',
141
 
                                     "A",
142
 
                                     [],
143
 
                                     [],
144
 
                                     repo.get_transaction())
 
143
        repo.fetch(tree.branch.repository)
 
144
        self.assertTrue(repo.has_revision('1'))
145
145
        try:
146
146
            self.make_repository('target', shared=True)
147
147
        except errors.IncompatibleFormat:
171
171
        self.assertTrue(shared_repo.has_revision('1'))
172
172
        
173
173
    def test_clone_bzrdir_repository_under_shared_force_new_repo(self):
 
174
        tree = self.make_branch_and_tree('commit_tree')
 
175
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
 
176
        tree.add('foo')
 
177
        tree.commit('revision 1', rev_id='1')
174
178
        dir = self.make_bzrdir('source')
175
179
        repo = dir.create_repository()
176
 
        # add some content to differentiate from an empty repository.
177
 
        repo.control_weaves.add_text('inventory',
178
 
                                     "A",
179
 
                                     [],
180
 
                                     [],
181
 
                                     repo.get_transaction())
 
180
        repo.fetch(tree.branch.repository)
 
181
        self.assertTrue(repo.has_revision('1'))
182
182
        try:
183
183
            self.make_repository('target', shared=True)
184
184
        except errors.IncompatibleFormat:
400
400
        target.open_workingtree()
401
401
    
402
402
    def test_sprout_bzrdir_repository(self):
 
403
        tree = self.make_branch_and_tree('commit_tree')
 
404
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
 
405
        tree.add('foo')
 
406
        tree.commit('revision 1', rev_id='1')
403
407
        dir = self.make_bzrdir('source')
404
408
        repo = dir.create_repository()
405
 
        # add some content to differentiate from an empty repository.
406
 
        repo.control_weaves.add_text('inventory',
407
 
                                     "A",
408
 
                                     [],
409
 
                                     [],
410
 
                                     repo.get_transaction())
 
409
        repo.fetch(tree.branch.repository)
 
410
        self.assertTrue(repo.has_revision('1'))
411
411
        target = dir.sprout(self.get_url('target'))
412
412
        self.assertNotEqual(dir.transport.base, target.transport.base)
413
413
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)