/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 breezy/tests/per_workingtree/test_commit.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 16:40:42 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170610164042-zrxqgy2htyduvke2
MergeĀ rename-controldirĀ branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        finally:
95
95
            tree_a.unlock()
96
96
 
97
 
        tree_b = tree_a.bzrdir.sprout('B').open_workingtree()
 
97
        tree_b = tree_a.controldir.sprout('B').open_workingtree()
98
98
        self.build_tree(['B/xyz/'])
99
99
        tree_b.add(['xyz'], ['xyz-id'])
100
100
        tree_b.rename_one('a/m', 'xyz/m')
145
145
        self.build_tree(['foo'])
146
146
        wt.add('foo')
147
147
        wt.commit('commit one')
148
 
        wt2 = wt.bzrdir.sprout('to').open_workingtree()
 
148
        wt2 = wt.controldir.sprout('to').open_workingtree()
149
149
        wt2.commit('change_right')
150
150
        wt.merge_from_branch(wt2.branch)
151
151
        try:
233
233
        self.build_tree(['a'])
234
234
        wt.add(['a'])
235
235
        wt.commit('commit one')
236
 
        wt2 = wt.bzrdir.sprout('to').open_workingtree()
 
236
        wt2 = wt.controldir.sprout('to').open_workingtree()
237
237
        os.remove('a')
238
238
        os.mkdir('a')
239
239
        wt.commit('changed kind')
261
261
        except errors.UpgradeRequired:
262
262
            # older format.
263
263
            return
264
 
        master.bzrdir.transport.put_bytes('branch-format', 'garbage')
 
264
        master.controldir.transport.put_bytes('branch-format', 'garbage')
265
265
        del master
266
266
        # check its corrupted.
267
267
        self.assertRaises(errors.UnknownFormatError,
317
317
        wt.lock_write()
318
318
        self.build_tree(['a', 'b/', 'b/c', 'd'])
319
319
        wt.add(['a', 'b', 'b/c', 'd'], ['a-id', 'b-id', 'c-id', 'd-id'])
320
 
        this_dir = wt.bzrdir.root_transport
 
320
        this_dir = wt.controldir.root_transport
321
321
        this_dir.delete_tree('b')
322
322
        this_dir.delete('d')
323
323
        # now we have a tree with a through d in the inventory, but only
335
335
        wt.unlock()
336
336
        # the changes should have persisted to disk - reopen the workingtree
337
337
        # to be sure.
338
 
        wt = wt.bzrdir.open_workingtree()
 
338
        wt = wt.controldir.open_workingtree()
339
339
        wt.lock_read()
340
340
        self.assertTrue(wt.has_id('a-id'))
341
341
        self.assertFalse(wt.has_or_had_id('b-id'))
353
353
        wt.add(['a', 'b', 'b/c'], ['a-id', 'b-id', 'c-id'])
354
354
        wt.commit('first')
355
355
        wt.remove('b/c')
356
 
        this_dir = wt.bzrdir.root_transport
 
356
        this_dir = wt.controldir.root_transport
357
357
        this_dir.delete_tree('b')
358
358
        wt.lock_write()
359
359
        wt.commit('commit deleted rename')
368
368
    def test_commit_move_new(self):
369
369
        wt = self.make_branch_and_tree('first')
370
370
        wt.commit('first')
371
 
        wt2 = wt.bzrdir.sprout('second').open_workingtree()
 
371
        wt2 = wt.controldir.sprout('second').open_workingtree()
372
372
        self.build_tree(['second/name1'])
373
373
        wt2.add('name1', 'name1-id')
374
374
        wt2.commit('second')