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

(James Westby) add read locks around read_working_inventory() in test_commit_move

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
        wt.move(['hello'], 'a')
224
224
        r2 = 'test@rev-2'
225
225
        wt.commit('two', rev_id=r2, allow_pointless=False)
226
 
        self.check_inventory_shape(wt.read_working_inventory(),
227
 
                                   ['a', 'a/hello', 'b'])
 
226
        wt.lock_read()
 
227
        try:
 
228
            self.check_inventory_shape(wt.read_working_inventory(),
 
229
                                       ['a', 'a/hello', 'b'])
 
230
        finally:
 
231
            wt.unlock()
228
232
 
229
233
        wt.move(['b'], 'a')
230
234
        r3 = 'test@rev-3'
231
235
        wt.commit('three', rev_id=r3, allow_pointless=False)
232
 
        self.check_inventory_shape(wt.read_working_inventory(),
233
 
                                   ['a', 'a/hello', 'a/b'])
234
 
        self.check_inventory_shape(b.repository.get_revision_inventory(r3),
235
 
                                   ['a', 'a/hello', 'a/b'])
 
236
        wt.lock_read()
 
237
        try:
 
238
            self.check_inventory_shape(wt.read_working_inventory(),
 
239
                                       ['a', 'a/hello', 'a/b'])
 
240
            self.check_inventory_shape(b.repository.get_revision_inventory(r3),
 
241
                                       ['a', 'a/hello', 'a/b'])
 
242
        finally:
 
243
            wt.unlock()
236
244
 
237
245
        wt.move(['a/hello'], 'a/b')
238
246
        r4 = 'test@rev-4'
239
247
        wt.commit('four', rev_id=r4, allow_pointless=False)
240
 
        self.check_inventory_shape(wt.read_working_inventory(),
241
 
                                   ['a', 'a/b/hello', 'a/b'])
 
248
        wt.lock_read()
 
249
        try:
 
250
            self.check_inventory_shape(wt.read_working_inventory(),
 
251
                                       ['a', 'a/b/hello', 'a/b'])
 
252
        finally:
 
253
            wt.unlock()
242
254
 
243
255
        inv = b.repository.get_revision_inventory(r4)
244
256
        eq(inv['hello-id'].revision, r4)
245
257
        eq(inv['a-id'].revision, r1)
246
258
        eq(inv['b-id'].revision, r3)
247
 
        
 
259
 
248
260
    def test_removed_commit(self):
249
261
        """Commit with a removed file"""
250
262
        wt = self.make_branch_and_tree('.')