~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Commit final test-case-cleanups branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
        """Test fetch-revision operation."""
121
121
        wt = self.make_branch_and_tree('b1')
122
122
        b1 = wt.branch
123
 
        b2 = self.make_branch('b2')
124
 
        wt.bzrdir.root_transport.put_bytes('foo', 'hello')
 
123
        self.build_tree_contents([('b1/foo', 'hello')])
125
124
        wt.add(['foo'], ['foo-id'])
126
125
        wt.commit('lala!', rev_id='revision-1', allow_pointless=False)
127
126
 
128
 
        mutter('start fetch')
 
127
        b2 = self.make_branch('b2')
129
128
        self.assertEqual((1, []), b2.fetch(b1))
130
129
 
131
130
        rev = b2.repository.get_revision('revision-1')
134
133
 
135
134
    def test_get_revision_delta(self):
136
135
        tree_a = self.make_branch_and_tree('a')
137
 
        transport = tree_a.bzrdir.root_transport
138
 
        self.build_tree(['foo'], transport=transport)
 
136
        self.build_tree(['a/foo'])
139
137
        tree_a.add('foo', 'file1')
140
138
        tree_a.commit('rev1', rev_id='rev1')
141
 
        self.build_tree(['vla'], transport=transport)
 
139
        self.build_tree(['a/vla'])
142
140
        tree_a.add('vla', 'file2')
143
141
        tree_a.commit('rev2', rev_id='rev2')
144
142
 
152
150
    def get_unbalanced_tree_pair(self):
153
151
        """Return two branches, a and b, with one file in a."""
154
152
        tree_a = self.make_branch_and_tree('a')
155
 
        tree_a.bzrdir.root_transport.put_bytes_non_atomic('b', 'b')
 
153
        self.build_tree_contents([('a/b', 'b')])
156
154
        tree_a.add('b')
157
155
        tree_a.commit("silly commit", rev_id='A')
158
156
 
181
179
        #       what should that behaviour be ? Emailed the list.
182
180
        # First, make a branch with two commits.
183
181
        wt_a = self.make_branch_and_tree('a')
184
 
        transport = wt_a.bzrdir.root_transport
185
 
        self.build_tree(['one'], transport=transport)
 
182
        self.build_tree(['a/one'])
186
183
        wt_a.add(['one'])
187
184
        wt_a.commit('commit one', rev_id='1')
188
 
        self.build_tree(['two'], transport=transport)
 
185
        self.build_tree(['a/two'])
189
186
        wt_a.add(['two'])
190
187
        wt_a.commit('commit two', rev_id='2')
191
188
        # Now make a copy of the repository.
204
201
        # test sprouting with a prefix of the revision-history.
205
202
        # also needs not-on-revision-history behaviour defined.
206
203
        wt_a = self.make_branch_and_tree('a')
207
 
        self.build_tree(['one'], transport=wt_a.bzrdir.root_transport)
 
204
        self.build_tree(['a/one'])
208
205
        wt_a.add(['one'])
209
206
        wt_a.commit('commit one', rev_id='1')
210
 
        self.build_tree(['two'], transport=wt_a.bzrdir.root_transport)
 
207
        self.build_tree(['a/two'])
211
208
        wt_a.add(['two'])
212
209
        wt_a.commit('commit two', rev_id='2')
213
210
        repo_b = self.make_repository('b')
218
215
 
219
216
    def get_parented_branch(self):
220
217
        wt_a = self.make_branch_and_tree('a')
221
 
        self.build_tree(['one'], transport=wt_a.bzrdir.root_transport)
 
218
        self.build_tree(['a/one'])
222
219
        wt_a.add(['one'])
223
220
        wt_a.commit('commit one', rev_id='1')
224
221
 
357
354
        explicit nickname is set.  That is, an explicit nickname always
358
355
        overrides the implicit one.
359
356
        """
360
 
        # Make a branch in a directory called 'bzr.dev'
361
357
        t = get_transport(self.get_url())
362
 
        t.mkdir('bzr.dev')
363
358
        branch = self.make_branch('bzr.dev')
364
359
        # The nick will be 'bzr.dev', because there is no explicit nick set.
365
360
        self.assertEqual(branch.nick, 'bzr.dev')
391
386
 
392
387
    def test_commit_nicks(self):
393
388
        """Nicknames are committed to the revision"""
394
 
        get_transport(self.get_url()).mkdir('bzr.dev')
395
389
        wt = self.make_branch_and_tree('bzr.dev')
396
390
        branch = wt.branch
397
391
        branch.nick = "My happy branch"