~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-14 04:29:57 UTC
  • mfrom: (1912.1.2 bzr.mbp.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060814042957-3fa43995db57512a
(mbp) merge from 0.9, update for 0.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
        br_b = wt_a.bzrdir.open_branch().sprout(repo_b.bzrdir, revision_id='1')
182
182
        self.assertEqual(br_b.last_revision(), '1')
183
183
 
 
184
    def get_parented_branch(self):
 
185
        wt_a = self.make_branch_and_tree('a')
 
186
        self.build_tree(['a/one'])
 
187
        wt_a.add(['one'])
 
188
        wt_a.commit('commit one', rev_id='1')
 
189
 
 
190
        branch_b = wt_a.bzrdir.sprout('b', revision_id='1').open_branch()
 
191
        self.assertEqual(wt_a.branch.base, branch_b.get_parent())
 
192
        return branch_b
 
193
 
184
194
    def test_clone_branch_nickname(self):
185
195
        # test the nick name is preserved always
186
196
        raise TestSkipped('XXX branch cloning is not yet tested..')
187
197
 
188
198
    def test_clone_branch_parent(self):
189
199
        # test the parent is preserved always
190
 
        raise TestSkipped('XXX branch cloning is not yet tested..')
191
 
        
 
200
        branch_b = self.get_parented_branch()
 
201
        repo_c = self.make_repository('c')
 
202
        branch_b.repository.copy_content_into(repo_c)
 
203
        branch_c = branch_b.clone(repo_c.bzrdir)
 
204
        self.assertNotEqual(None, branch_c.get_parent())
 
205
        self.assertEqual(branch_b.get_parent(), branch_c.get_parent())
 
206
 
 
207
        # We can also set a specific parent, and it should be honored
 
208
        random_parent = 'http://bazaar-vcs.org/path/to/branch'
 
209
        branch_b.set_parent(random_parent)
 
210
        repo_d = self.make_repository('d')
 
211
        branch_b.repository.copy_content_into(repo_d)
 
212
        branch_d = branch_b.clone(repo_d.bzrdir)
 
213
        self.assertEqual(random_parent, branch_d.get_parent())
 
214
 
192
215
    def test_sprout_branch_nickname(self):
193
216
        # test the nick name is reset always
194
217
        raise TestSkipped('XXX branch sprouting is not yet tested..')