/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/per_repository/test_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for repository implementations - tests a repository format."""
18
18
 
19
 
from cStringIO import StringIO
20
19
import re
21
20
 
22
 
from bzrlib import (
 
21
from ... import (
23
22
    branch as _mod_branch,
24
23
    controldir,
25
24
    delta as _mod_delta,
35
34
    upgrade,
36
35
    workingtree,
37
36
    )
38
 
from bzrlib.repofmt import (
 
37
from ...repofmt import (
39
38
    knitpack_repo,
40
39
    )
41
 
from bzrlib.tests import (
 
40
from ...sixish import (
 
41
    BytesIO,
 
42
    )
 
43
from .. import (
42
44
    per_repository,
43
45
    test_server,
44
46
    )
45
 
from bzrlib.tests.matchers import *
 
47
from ..matchers import *
46
48
 
47
49
 
48
50
class TestRepositoryMakeBranchAndTree(per_repository.TestCaseWithRepository):
348
350
        except errors.UpToDateFormat:
349
351
            # this is in the most current format already.
350
352
            return
351
 
        except errors.BadConversionTarget, e:
 
353
        except errors.BadConversionTarget as e:
352
354
            raise tests.TestSkipped(str(e))
353
355
        wt = workingtree.WorkingTree.open(wt.basedir)
354
356
        new_signature = wt.branch.repository.get_signature_text('A')
628
630
            self.get_vfs_only_url('remote')).open_repository()
629
631
        # Make a branch in that repo in an old format that isn't the default
630
632
        # branch format for the repo.
631
 
        from bzrlib.branchfmt.fullhistory import BzrBranchFormat5
 
633
        from breezy.branchfmt.fullhistory import BzrBranchFormat5
632
634
        format = remote_backing_repo.bzrdir.cloning_metadir()
633
635
        format._branch_format = BzrBranchFormat5()
634
636
        remote_transport = remote_repo.bzrdir.root_transport.clone('branch')
794
796
        repo = self.make_repository('repo')
795
797
        try:
796
798
            repo.set_make_working_trees(True)
797
 
        except (errors.RepositoryUpgradeRequired, errors.UnsupportedOperation), e:
 
799
        except (errors.RepositoryUpgradeRequired, errors.UnsupportedOperation) as e:
798
800
            raise tests.TestNotApplicable('Format does not support this flag.')
799
801
        self.assertTrue(repo.make_working_trees())
800
802
 
802
804
        repo = self.make_repository('repo')
803
805
        try:
804
806
            repo.set_make_working_trees(False)
805
 
        except (errors.RepositoryUpgradeRequired, errors.UnsupportedOperation), e:
 
807
        except (errors.RepositoryUpgradeRequired, errors.UnsupportedOperation) as e:
806
808
            raise tests.TestNotApplicable('Format does not support this flag.')
807
809
        self.assertFalse(repo.make_working_trees())
808
810
 
918
920
        self.build_tree(['repo/file1'])
919
921
        wt.add('file1')
920
922
        wt.commit('file1', rev_id='rev1')
921
 
        fileobj = StringIO()
 
923
        fileobj = BytesIO()
922
924
        wt.branch.repository.create_bundle(
923
925
            'rev1', _mod_revision.NULL_REVISION, fileobj)
924
926