/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

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
        repo_b = self.make_repository('b')
165
165
        wt_a.bzrdir.open_repository().copy_content_into(repo_b)
166
166
        br_b = wt_a.bzrdir.open_branch().clone(repo_b.bzrdir, revision_id='1')
167
 
        self.assertEqual(br_b.last_revision(), '1')
 
167
        self.assertEqual('1', br_b.last_revision())
168
168
 
169
169
    def test_sprout_partial(self):
170
170
        # test sprouting with a prefix of the revision-history.
179
179
        repo_b = self.make_repository('b')
180
180
        wt_a.bzrdir.open_repository().copy_content_into(repo_b)
181
181
        br_b = wt_a.bzrdir.open_branch().sprout(repo_b.bzrdir, revision_id='1')
182
 
        self.assertEqual(br_b.last_revision(), '1')
 
182
        self.assertEqual('1', br_b.last_revision())
183
183
 
184
184
    def get_parented_branch(self):
185
185
        wt_a = self.make_branch_and_tree('a')
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.