/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 bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: Robert Collins
  • Date: 2006-11-22 02:49:26 UTC
  • mto: (2018.5.34 hpss)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: robertc@robertcollins.net-20061122024926-41ba3a48a35200ee
Implement a BzrDir.open_branch smart server method for opening a branch without VFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
497
497
            self.assertRaises(errors.NotLocalUrl, target.create_workingtree)
498
498
        self.assertTrue(target.open_branch().repository.has_revision('2'))
499
499
 
 
500
    def test_get_branch_reference_on_reference(self):
 
501
        """get_branch_reference should return the right url."""
 
502
        referenced_branch = self.make_branch('referenced')
 
503
        dir = self.make_bzrdir('source')
 
504
        try:
 
505
            reference = bzrlib.branch.BranchReferenceFormat().initialize(dir,
 
506
                referenced_branch)
 
507
        except errors.IncompatibleFormat:
 
508
            # this is ok too, not all formats have to support references.
 
509
            return
 
510
        self.assertEqual(referenced_branch.bzrdir.root_transport.abspath('') + '/',
 
511
            dir.get_branch_reference())
 
512
 
 
513
    def test_get_branch_reference_on_non_reference(self):
 
514
        """get_branch_reference should return None for non-reference branches."""
 
515
        branch = self.make_branch('referenced')
 
516
        self.assertEqual(None, branch.bzrdir.get_branch_reference())
 
517
 
 
518
    def test_get_branch_reference_no_branch(self):
 
519
        """get_branch_reference should not mask NotBranchErrors."""
 
520
        dir = self.make_bzrdir('source')
 
521
        if dir.has_branch():
 
522
            # this format does not support branchless bzrdirs.
 
523
            return
 
524
        self.assertRaises(errors.NotBranchError, dir.get_branch_reference)
 
525
 
500
526
    def test_sprout_bzrdir_empty(self):
501
527
        dir = self.make_bzrdir('source')
502
528
        target = self.sproutOrSkip(dir, self.get_url('target'))