/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 breezy/tests/per_controldir/test_controldir.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from itertools import izip
20
20
 
21
 
import brzlib.branch
22
 
from brzlib import (
 
21
import breezy.branch
 
22
from breezy import (
23
23
    bzrdir as _mod_bzrdir,
24
24
    check,
25
25
    controldir,
32
32
    urlutils,
33
33
    workingtree,
34
34
    )
35
 
from brzlib.tests import (
 
35
from breezy.tests import (
36
36
    fixtures,
37
37
    ChrootedTestCase,
38
38
    TestNotApplicable,
39
39
    TestSkipped,
40
40
    )
41
 
from brzlib.tests.per_controldir import TestCaseWithControlDir
42
 
from brzlib.transport.local import LocalTransport
43
 
from brzlib.ui import (
 
41
from breezy.tests.per_controldir import TestCaseWithControlDir
 
42
from breezy.transport.local import LocalTransport
 
43
from breezy.ui import (
44
44
    CannedInputUIFactory,
45
45
    )
46
 
from brzlib.remote import (
 
46
from breezy.remote import (
47
47
    RemoteBzrDir,
48
48
    RemoteBzrDirFormat,
49
49
    RemoteRepository,
371
371
            format = None
372
372
        source_branch = self.make_branch('source', format=format)
373
373
        # Ensure no format data is cached
374
 
        a_dir = brzlib.branch.Branch.open_from_transport(
 
374
        a_dir = breezy.branch.Branch.open_from_transport(
375
375
            self.get_transport('source')).bzrdir
376
376
        target_transport = self.get_transport('target')
377
377
        target_bzrdir = a_dir.clone_on_transport(target_transport)
378
378
        target_repo = target_bzrdir.open_repository()
379
 
        source_branch = brzlib.branch.Branch.open(
 
379
        source_branch = breezy.branch.Branch.open(
380
380
            self.get_vfs_only_url('source'))
381
381
        if isinstance(target_repo, RemoteRepository):
382
382
            target_repo._ensure_real()
1194
1194
        made_control = self.bzrdir_format.initialize(t.base)
1195
1195
        made_repo = made_control.create_repository()
1196
1196
        made_branch = made_control.create_branch()
1197
 
        self.assertIsInstance(made_branch, brzlib.branch.Branch)
 
1197
        self.assertIsInstance(made_branch, breezy.branch.Branch)
1198
1198
        self.assertEqual(made_control, made_branch.bzrdir)
1199
1199
 
1200
1200
    def test_create_branch_append_revisions_only(self):
1213
1213
        except errors.UpgradeRequired:
1214
1214
            raise TestNotApplicable("format does not support "
1215
1215
                "append_revisions_only setting")
1216
 
        self.assertIsInstance(made_branch, brzlib.branch.Branch)
 
1216
        self.assertIsInstance(made_branch, breezy.branch.Branch)
1217
1217
        self.assertEqual(True, made_branch.get_append_revisions_only())
1218
1218
        self.assertEqual(made_control, made_branch.bzrdir)
1219
1219
 
1618
1618
            raise TestNotApplicable("format does not physically lock")
1619
1619
        # only one yes needed here: it should only be unlocking
1620
1620
        # the repo
1621
 
        brzlib.ui.ui_factory = CannedInputUIFactory([True])
 
1621
        breezy.ui.ui_factory = CannedInputUIFactory([True])
1622
1622
        try:
1623
1623
            repo.bzrdir.break_lock()
1624
1624
        except NotImplementedError:
1649
1649
            # two yes's : branch and repository. If the repo in this
1650
1650
            # dir is inappropriately accessed, 3 will be needed, and
1651
1651
            # we'll see that because the stream will be fully consumed
1652
 
            brzlib.ui.ui_factory = CannedInputUIFactory([True, True, True])
 
1652
            breezy.ui.ui_factory = CannedInputUIFactory([True, True, True])
1653
1653
            # determine if the repository will have been locked;
1654
1654
            this_repo_locked = \
1655
1655
                thisdir.open_repository().get_physical_lock_status()
1657
1657
            if this_repo_locked:
1658
1658
                # only two ys should have been read
1659
1659
                self.assertEqual([True],
1660
 
                    brzlib.ui.ui_factory.responses)
 
1660
                    breezy.ui.ui_factory.responses)
1661
1661
            else:
1662
1662
                # only one y should have been read
1663
1663
                self.assertEqual([True, True],
1664
 
                    brzlib.ui.ui_factory.responses)
 
1664
                    breezy.ui.ui_factory.responses)
1665
1665
            # we should be able to lock a newly opened branch now
1666
1666
            branch = master.bzrdir.open_branch()
1667
1667
            branch.lock_write()
1685
1685
        tree = self.make_branch_and_tree('.')
1686
1686
        tree.lock_write()
1687
1687
        # three yes's : tree, branch and repository.
1688
 
        brzlib.ui.ui_factory = CannedInputUIFactory([True, True, True])
 
1688
        breezy.ui.ui_factory = CannedInputUIFactory([True, True, True])
1689
1689
        try:
1690
1690
            tree.bzrdir.break_lock()
1691
1691
        except (NotImplementedError, errors.LockActive):
1696
1696
            tree.unlock()
1697
1697
            raise TestNotApplicable("format does not support breaking locks")
1698
1698
        self.assertEqual([True],
1699
 
                brzlib.ui.ui_factory.responses)
 
1699
                breezy.ui.ui_factory.responses)
1700
1700
        lock_tree = tree.bzrdir.open_workingtree()
1701
1701
        lock_tree.lock_write()
1702
1702
        lock_tree.unlock()