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

  • Committer: Vincent Ladeuil
  • Date: 2011-11-18 07:29:20 UTC
  • mfrom: (6277 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6278.
  • Revision ID: v.ladeuil+lp@free.fr-20111118072920-76q1ho772bkmnno2
Merge trunk to resolve news conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from bzrlib.tests import TestCaseWithTransport
31
31
from bzrlib.tests import (
32
32
    fixtures,
33
 
    script,
34
33
    test_server,
35
34
    )
36
35
from bzrlib.tests.features import (
45
44
 
46
45
class TestBranch(TestCaseWithTransport):
47
46
 
48
 
    def example_branch(self, path='.'):
49
 
        tree = self.make_branch_and_tree(path)
 
47
    def example_branch(self, path='.', format=None):
 
48
        tree = self.make_branch_and_tree(path, format=format)
50
49
        self.build_tree_contents([(path + '/hello', 'foo')])
51
50
        tree.add('hello')
52
51
        tree.commit(message='setup')
53
52
        self.build_tree_contents([(path + '/goodbye', 'baz')])
54
53
        tree.add('goodbye')
55
54
        tree.commit(message='setup')
 
55
        return tree
56
56
 
57
57
    def test_branch(self):
58
58
        """Branch from one branch to another."""
70
70
        out, err = self.run_bzr(
71
71
            'init --format=development-colo file:b,branch=orig')
72
72
        self.assertEqual(
73
 
            """Created a standalone tree (format: development-colo)\n""",
 
73
            """Created a lightweight checkout (format: development-colo)\n""",
74
74
            out)
75
75
        self.assertEqual('', err)
76
76
        out, err = self.run_bzr(
77
 
            'branch --use-existing-dir a file:b,branch=thiswasa')
 
77
            'branch a file:b,branch=thiswasa')
78
78
        self.assertEqual('', out)
79
79
        self.assertEqual('Branched 2 revisions.\n', err)
80
80
        out, err = self.run_bzr('branches b')
81
81
        self.assertEqual(" orig\n thiswasa\n", out)
82
82
        self.assertEqual('', err)
 
83
        out,err = self.run_bzr('branch a file:b,branch=orig', retcode=3)
 
84
        self.assertEqual('', out)
 
85
        self.assertEqual('bzr: ERROR: Already a branch: "file:b,branch=orig".\n', err)
 
86
 
 
87
    def test_from_colocated(self):
 
88
        """Branch from a colocated branch into a regular branch."""
 
89
        tree = self.example_branch('a', format='development-colo')
 
90
        tree.bzrdir.create_branch(name='somecolo')
 
91
        out, err = self.run_bzr('branch %s,branch=somecolo' %
 
92
            local_path_to_url('a'))
 
93
        self.assertEqual('', out)
 
94
        self.assertEqual('Branched 0 revisions.\n', err)
 
95
        self.assertPathExists("somecolo")
83
96
 
84
97
    def test_branch_broken_pack(self):
85
98
        """branching with a corrupted pack file."""
469
482
        # being too low. If rpc_count increases, more network roundtrips have
470
483
        # become necessary for this use case. Please do not adjust this number
471
484
        # upwards without agreement from bzr's network support maintainers.
472
 
        self.assertLength(39, self.hpss_calls)
 
485
        self.assertLength(40, self.hpss_calls)
473
486
 
474
487
    def test_branch_from_trivial_branch_streaming_acceptance(self):
475
488
        self.setup_smart_server_with_call_log()