~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Shannon Weyrick
  • Date: 2011-11-04 13:40:04 UTC
  • mfrom: (6238 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6256.
  • Revision ID: weyrick@mozek.us-20111104134004-033t2wqhc3ydzm0a
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import (
23
23
    branch,
24
24
    bzrdir,
 
25
    controldir,
25
26
    errors,
26
27
    revision as _mod_revision,
27
28
    )
63
64
        self.assertFalse(b._transport.has('branch-name'))
64
65
        b.bzrdir.open_workingtree().commit(message='foo', allow_pointless=True)
65
66
 
 
67
    def test_into_colocated(self):
 
68
        """Branch from a branch into a colocated branch."""
 
69
        self.example_branch('a')
 
70
        out, err = self.run_bzr(
 
71
            'init --format=development-colo file:b,branch=orig')
 
72
        self.assertEqual(
 
73
            """Created a standalone tree (format: development-colo)\n""",
 
74
            out)
 
75
        self.assertEqual('', err)
 
76
        out, err = self.run_bzr(
 
77
            'branch --use-existing-dir a file:b,branch=thiswasa')
 
78
        self.assertEqual('', out)
 
79
        self.assertEqual('Branched 2 revisions.\n', err)
 
80
        out, err = self.run_bzr('branches b')
 
81
        self.assertEqual(" orig\n thiswasa\n", out)
 
82
        self.assertEqual('', err)
 
83
 
66
84
    def test_branch_broken_pack(self):
67
85
        """branching with a corrupted pack file."""
68
86
        self.example_branch('a')
159
177
 
160
178
        def make_shared_tree(path):
161
179
            shared_repo.bzrdir.root_transport.mkdir(path)
162
 
            shared_repo.bzrdir.create_branch_convenience('repo/' + path)
 
180
            controldir.ControlDir.create_branch_convenience('repo/' + path)
163
181
            return WorkingTree.open('repo/' + path)
164
182
        tree_a = make_shared_tree('a')
165
183
        self.build_tree(['repo/a/file'])