/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_cat.py

  • Committer: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        # tree and the working tree
80
80
        self.build_tree_contents([('a-rev-tree', 'foo\n'),
81
81
            ('c-rev', 'baz\n'), ('d-rev', 'bar\n'), ('e-rev', 'qux\n')])
82
 
        tree.lock_write()
83
 
        try:
 
82
        with tree.lock_write():
84
83
            tree.add(['a-rev-tree', 'c-rev', 'd-rev', 'e-rev'])
85
84
            tree.commit('add test files', rev_id='first')
86
85
            # remove currently uses self._write_inventory -
92
91
            tree.rename_one('e-rev', 'old-rev')
93
92
            self.build_tree_contents([('e-rev', 'new\n')])
94
93
            tree.add(['e-rev'])
95
 
        finally:
96
 
            # calling brz as another process require free lock on win32
97
 
            tree.unlock()
98
94
 
99
95
        # 'b-tree' is not present in the old tree.
100
96
        self.run_bzr_error(["^brz: ERROR: u?'b-tree' "
103
99
 
104
100
        # get to the old file automatically
105
101
        out, err = self.run_bzr('cat d-rev')
 
102
        self.assertEqual('', err)
106
103
        self.assertEqual('bar\n', out)
107
 
        self.assertEqual('', err)
108
104
 
109
105
        out, err = \
110
106
                self.run_bzr('cat a-rev-tree --name-from-revision')