~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-01-28 13:24:39 UTC
  • mfrom: (6450.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20120128132439-phvlss4cq7bf5rji
(jelmer) Merge the 2.5 branch. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        self.assertFalse(b._transport.has('branch-name'))
66
66
        b.bzrdir.open_workingtree().commit(message='foo', allow_pointless=True)
67
67
 
 
68
    def test_branch_no_to_location(self):
 
69
        """The to_location is derived from the source branch name."""
 
70
        os.mkdir("something")
 
71
        a = self.example_branch('something/a').branch
 
72
        self.run_bzr('branch something/a')
 
73
        b = branch.Branch.open('a')
 
74
        self.assertEquals(b.last_revision_info(), a.last_revision_info())
 
75
 
68
76
    def test_into_colocated(self):
69
77
        """Branch from a branch into a colocated branch."""
70
78
        self.example_branch('a')
147
155
        #  => new branch will be created, but switch fails and the current
148
156
        #     branch is unmodified
149
157
        self.example_branch('a')
150
 
        self.make_branch_and_tree('current')
 
158
        tree = self.make_branch_and_tree('current')
 
159
        c1 = tree.commit('some diverged change')
151
160
        self.run_bzr_error(['Cannot switch a branch, only a checkout'],
152
161
            'branch --switch ../a ../b', working_dir='current')
153
162
        a = branch.Branch.open('a')
154
163
        b = branch.Branch.open('b')
155
164
        self.assertEqual(a.last_revision(), b.last_revision())
156
165
        work = branch.Branch.open('current')
157
 
        self.assertEqual(work.last_revision(), _mod_revision.NULL_REVISION)
 
166
        self.assertEqual(work.last_revision(), c1)
158
167
 
159
168
    def test_branch_into_empty_dir(self):
160
169
        t = self.example_branch('source')