~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-07-16 07:54:18 UTC
  • mfrom: (3537.3.5 stacking)
  • Revision ID: pqm@pqm.ubuntu.com-20080716075418-xbachkqt622m73v1
(mbp) post-merge review cleanups for stacking

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
    def get_format_name_subtree(self):
319
319
        return "dirstate-with-subtree"
320
320
 
321
 
    def test_set_stacked_on_errors(self):
 
321
    def test_set_stacked_on_url_errors(self):
322
322
        branch = self.make_branch('a', format=self.get_format_name())
323
323
        self.assertRaises(errors.UnstackableBranchFormat,
324
 
            branch.set_stacked_on, None)
 
324
            branch.set_stacked_on_url, None)
325
325
 
326
326
    def test_default_stacked_location(self):
327
327
        branch = self.make_branch('a', format=self.get_format_name())
339
339
    def get_format_name_subtree(self):
340
340
        return "development-subtree"
341
341
 
342
 
    def test_set_stacked_on_unstackable_repo(self):
 
342
    def test_set_stacked_on_url_unstackable_repo(self):
343
343
        repo = self.make_repository('a', format='dirstate-tags')
344
344
        control = repo.bzrdir
345
345
        branch = _mod_branch.BzrBranchFormat7().initialize(control)
346
346
        target = self.make_branch('b')
347
347
        self.assertRaises(errors.UnstackableRepositoryFormat,
348
 
            branch.set_stacked_on, target.base)
 
348
            branch.set_stacked_on_url, target.base)
 
349
 
 
350
    def test_clone_stacked_on_unstackable_repo(self):
 
351
        repo = self.make_repository('a', format='dirstate-tags')
 
352
        control = repo.bzrdir
 
353
        branch = _mod_branch.BzrBranchFormat7().initialize(control)
 
354
        # Calling clone should not raise UnstackableRepositoryFormat.
 
355
        cloned_bzrdir = control.clone('cloned')
349
356
 
350
357
    def _test_default_stacked_location(self):
351
358
        branch = self.make_branch('a', format=self.get_format_name())
354
361
    def test_stack_and_unstack(self):
355
362
        branch = self.make_branch('a', format=self.get_format_name())
356
363
        target = self.make_branch_and_tree('b', format=self.get_format_name())
357
 
        branch.set_stacked_on(target.branch.base)
 
364
        branch.set_stacked_on_url(target.branch.base)
358
365
        self.assertEqual(target.branch.base, branch.get_stacked_on_url())
359
366
        revid = target.commit('foo')
360
367
        self.assertTrue(branch.repository.has_revision(revid))
361
 
        branch.set_stacked_on(None)
 
368
        branch.set_stacked_on_url(None)
362
369
        self.assertRaises(errors.NotStacked, branch.get_stacked_on_url)
363
370
        self.assertFalse(branch.repository.has_revision(revid))
364
371
 
365
372
    def test_open_opens_stacked_reference(self):
366
373
        branch = self.make_branch('a', format=self.get_format_name())
367
374
        target = self.make_branch_and_tree('b', format=self.get_format_name())
368
 
        branch.set_stacked_on(target.branch.base)
 
375
        branch.set_stacked_on_url(target.branch.base)
369
376
        branch = branch.bzrdir.open_branch()
370
377
        revid = target.commit('foo')
371
378
        self.assertTrue(branch.repository.has_revision(revid))