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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-07-27 23:53:10 UTC
  • mfrom: (7356.1.10 exitstack)
  • Revision ID: breezy.the.bot@gmail.com-20190727235310-ccs69jhu4pq55qsi
Use contextlib.ExitStack rather than our homegrown OperationWithCleanups.

Merged from https://code.launchpad.net/~jelmer/brz/exitstack/+merge/369203

Show diffs side-by-side

added added

removed removed

Lines of Context:
316
316
        this_tree.commit('create_files')
317
317
        other_dir = this_tree.controldir.sprout('other')
318
318
        other_tree = other_dir.open_workingtree()
319
 
        other_tree.lock_write()
320
 
        # perform the needed actions on the files and dirs.
321
 
        try:
 
319
        with other_tree.lock_write():
 
320
            # perform the needed actions on the files and dirs.
322
321
            other_tree.rename_one('dirtorename', 'renameddir')
323
322
            other_tree.rename_one('dirtoreparent', 'renameddir/reparenteddir')
324
323
            other_tree.rename_one('filetorename', 'renamedfile')
332
331
            other_tree.add('newfile')
333
332
            other_tree.add('newdir/')
334
333
            other_tree.commit('modify all sample files and dirs.')
335
 
        finally:
336
 
            other_tree.unlock()
337
334
        this_tree.merge_from_branch(other_tree.branch)
338
335
        out, err = self.run_bzr('commit -m added', working_dir='this')
339
336
        self.assertEqual('', out)