~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-04 22:23:20 UTC
  • mfrom: (5825 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5830.
  • Revision ID: jelmer@samba.org-20110504222320-bczsppms2wadcrb4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
262
262
        eq(tree1.id2path('hello-id'), 'hello')
263
263
        eq(tree1.get_file_text('hello-id'), 'contents of hello\n')
264
264
        self.assertFalse(tree1.has_filename('fruity'))
265
 
        self.check_inventory_shape(tree1.inventory, ['hello'])
266
 
        ie = tree1.inventory['hello-id']
267
 
        eq(ie.revision, 'test@rev-1')
 
265
        self.check_tree_shape(tree1, ['hello'])
 
266
        eq(tree1.get_file_revision('hello-id'), 'test@rev-1')
268
267
 
269
268
        tree2 = b.repository.revision_tree('test@rev-2')
270
269
        tree2.lock_read()
271
270
        self.addCleanup(tree2.unlock)
272
271
        eq(tree2.id2path('hello-id'), 'fruity')
273
272
        eq(tree2.get_file_text('hello-id'), 'contents of hello\n')
274
 
        self.check_inventory_shape(tree2.inventory, ['fruity'])
275
 
        ie = tree2.inventory['hello-id']
276
 
        eq(ie.revision, 'test@rev-2')
 
273
        self.check_tree_shape(tree2, ['fruity'])
 
274
        eq(tree2.get_file_revision('hello-id'), 'test@rev-2')
277
275
 
278
276
    def test_reused_rev_id(self):
279
277
        """Test that a revision id cannot be reused in a branch"""
300
298
        wt.commit('two', rev_id=r2, allow_pointless=False)
301
299
        wt.lock_read()
302
300
        try:
303
 
            self.check_inventory_shape(wt.read_working_inventory(),
304
 
                                       ['a/', 'a/hello', 'b/'])
 
301
            self.check_tree_shape(wt, ['a/', 'a/hello', 'b/'])
305
302
        finally:
306
303
            wt.unlock()
307
304
 
310
307
        wt.commit('three', rev_id=r3, allow_pointless=False)
311
308
        wt.lock_read()
312
309
        try:
313
 
            self.check_inventory_shape(wt.read_working_inventory(),
 
310
            self.check_tree_shape(wt,
314
311
                                       ['a/', 'a/hello', 'a/b/'])
315
 
            self.check_inventory_shape(b.repository.get_inventory(r3),
 
312
            self.check_tree_shape(b.repository.revision_tree(r3),
316
313
                                       ['a/', 'a/hello', 'a/b/'])
317
314
        finally:
318
315
            wt.unlock()
322
319
        wt.commit('four', rev_id=r4, allow_pointless=False)
323
320
        wt.lock_read()
324
321
        try:
325
 
            self.check_inventory_shape(wt.read_working_inventory(),
326
 
                                       ['a/', 'a/b/hello', 'a/b/'])
 
322
            self.check_tree_shape(wt, ['a/', 'a/b/hello', 'a/b/'])
327
323
        finally:
328
324
            wt.unlock()
329
325