~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_switch.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
        self.run_bzr('switch --directory checkout b')
279
279
        self.assertFileEqual('initial\nmore\n', 'checkout/a')
280
280
 
281
 
 
282
281
class TestSwitchParentLocationBase(TestCaseWithTransport):
283
282
 
284
283
    def setUp(self):
329
328
        self.assertParent('repo/trunk', bb)
330
329
        self.assertParent('repo/trunk', mb)
331
330
 
332
 
 
333
 
class TestSwitchDoesntOpenMasterBranch(TestCaseWithTransport):
334
 
    # See https://bugs.launchpad.net/bzr/+bug/812285
335
 
    # "bzr switch --create-branch" can point the new branch's parent to the
336
 
    # master branch, but it doesn't have to open it to do so.
337
 
 
338
 
    def test_switch_create_doesnt_open_master_branch(self):
339
 
        master = self.make_branch_and_tree('master')
340
 
        master.commit('one')
341
 
        # Note: not a lightweight checkout
342
 
        checkout = master.branch.create_checkout('checkout')
343
 
        opened = []
344
 
        def open_hook(branch):
345
 
            # Just append the final directory of the branch
346
 
            name = branch.base.rstrip('/').rsplit('/', 1)[1]
347
 
            opened.append(name)
348
 
        branch.Branch.hooks.install_named_hook('open', open_hook,
349
 
                                               'open_hook_logger')
350
 
        self.run_bzr('switch --create-branch -d checkout feature')
351
 
        # We only open the master branch 1 time.
352
 
        # This test should be cleaner to write, but see bug:
353
 
        #  https://bugs.launchpad.net/bzr/+bug/812295
354
 
        self.assertEqual(1, opened.count('master'))