/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/branch_implementations/test_branch.py

  • Committer: Robert Collins
  • Date: 2006-09-10 23:56:57 UTC
  • mto: This revision was merged to the branch mainline in revision 2000.
  • Revision ID: robertc@robertcollins.net-20060910235657-56a542e8af8f28de
``bzr checkout --lightweight`` now operates on readonly branches as well
as readwrite branches. This fixes bug #39542 for lightweight checkouts 
but not for heavyweight ones (the default). (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
405
405
        os.mkdir('e')
406
406
        checkout_e = branch_a.create_checkout('e')
407
407
 
 
408
    def test_create_anonymous_lightweight_checkout(self):
 
409
        """A checkout from a readonly branch should succeed."""
 
410
        tree_a = self.make_branch_and_tree('a')
 
411
        rev_id = tree_a.commit('put some content in the branch')
 
412
        source_branch = bzrlib.branch.Branch.open(
 
413
            'readonly+' + tree_a.bzrdir.root_transport.base)
 
414
        # sanity check that the test will be valid
 
415
        self.assertRaises((errors.LockError, errors.TransportNotPossible),
 
416
            source_branch.lock_write)
 
417
        checkout = source_branch.create_checkout('c', lightweight=True)
 
418
        self.assertEqual(rev_id, checkout.last_revision())
 
419
 
408
420
 
409
421
class ChrootedTests(TestCaseWithBranch):
410
422
    """A support class that provides readonly urls outside the local namespace.