/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/blackbox/test_switch.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
 
23
 
from bzrlib.controldir import ControlDir
24
 
from bzrlib import (
 
23
from breezy.controldir import ControlDir
 
24
from breezy import (
25
25
    osutils,
26
26
    urlutils,
27
27
    branch,
28
28
    )
29
 
from bzrlib.workingtree import WorkingTree
30
 
from bzrlib.tests import (
 
29
from breezy.workingtree import WorkingTree
 
30
from breezy.tests import (
31
31
    TestCaseWithTransport,
32
32
    script,
33
33
    )
34
 
from bzrlib.tests.features import UnicodeFilenameFeature
35
 
from bzrlib.directory_service import directories
 
34
from breezy.tests.features import UnicodeFilenameFeature
 
35
from breezy.directory_service import directories
36
36
 
37
 
from bzrlib.tests.matchers import ContainsNoVfsCalls
 
37
from breezy.tests.matchers import ContainsNoVfsCalls
38
38
 
39
39
 
40
40
class TestSwitch(TestCaseWithTransport):
288
288
        self.assertPathDoesNotExist('checkout/file-2')
289
289
        # Check that we don't accept a range
290
290
        self.run_bzr_error(
291
 
            ['bzr switch --revision takes exactly one revision identifier'],
 
291
            ['brz switch --revision takes exactly one revision identifier'],
292
292
            ['switch', '-r0..2'], working_dir='checkout')
293
293
 
294
294
    def prepare_lightweight_switch(self):
355
355
        self.assertEndsWith(tree.branch.base, 'foo-branch2/')
356
356
 
357
357
    def test_switch_with_post_switch_hook(self):
358
 
        from bzrlib import branch as _mod_branch
 
358
        from breezy import branch as _mod_branch
359
359
        calls = []
360
360
        _mod_branch.Branch.hooks.install_named_hook('post_switch',
361
361
            calls.append, None)
368
368
        self.assertLength(1, calls)
369
369
 
370
370
    def test_switch_lightweight_co_with_post_switch_hook(self):
371
 
        from bzrlib import branch as _mod_branch
 
371
        from breezy import branch as _mod_branch
372
372
        calls = []
373
373
        _mod_branch.Branch.hooks.install_named_hook('post_switch',
374
374
            calls.append, None)
406
406
        super(TestSwitchParentLocationBase, self).setUp()
407
407
        self.script_runner = script.ScriptRunner()
408
408
        self.script_runner.run_script(self, '''
409
 
                $ bzr init-repo --no-trees repo
 
409
                $ brz init-repo --no-trees repo
410
410
                Shared repository...
411
411
                Location:
412
412
                  shared repository: repo
413
 
                $ bzr init repo/trunk
 
413
                $ brz init repo/trunk
414
414
                Created a repository branch...
415
415
                Using shared repository: ...
416
416
                ''')
426
426
 
427
427
    def _checkout_and_switch(self, option=''):
428
428
        self.script_runner.run_script(self, '''
429
 
                $ bzr checkout %(option)s repo/trunk checkout
 
429
                $ brz checkout %(option)s repo/trunk checkout
430
430
                $ cd checkout
431
 
                $ bzr switch --create-branch switched
 
431
                $ brz switch --create-branch switched
432
432
                2>Tree is up to date at revision 0.
433
433
                2>Switched to branch:...switched...
434
434
                $ cd ..
438
438
        return (bound_branch, master_branch)
439
439
 
440
440
    def test_switch_parent_lightweight(self):
441
 
        """Lightweight checkout using bzr switch."""
 
441
        """Lightweight checkout using brz switch."""
442
442
        bb, mb = self._checkout_and_switch(option='--lightweight')
443
443
        self.assertParent('repo/trunk', bb)
444
444
        self.assertParent('repo/trunk', mb)
445
445
 
446
446
    def test_switch_parent_heavyweight(self):
447
 
        """Heavyweight checkout using bzr switch."""
 
447
        """Heavyweight checkout using brz switch."""
448
448
        bb, mb = self._checkout_and_switch()
449
449
        self.assertParent('repo/trunk', bb)
450
450
        self.assertParent('repo/trunk', mb)
452
452
 
453
453
class TestSwitchDoesntOpenMasterBranch(TestCaseWithTransport):
454
454
    # See https://bugs.launchpad.net/bzr/+bug/812285
455
 
    # "bzr switch --create-branch" can point the new branch's parent to the
 
455
    # "brz switch --create-branch" can point the new branch's parent to the
456
456
    # master branch, but it doesn't have to open it to do so.
457
457
 
458
458
    def test_switch_create_doesnt_open_master_branch(self):