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

  • Committer: Robert Collins
  • Date: 2006-03-03 02:09:49 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060303020949-0ddc6f33d0a43943
Smoke test for RevisionStore factories creating revision stores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
        self.assertEqual(self.file_1.revision, '1')
264
264
        self.assertEqual(self.file_active.revision, '2')
265
265
        # this should be a separate test probably, but lets check it once..
266
 
        lines = self.branch.repository.weave_store.get_weave(
267
 
            'fileid', 
268
 
            self.branch.get_transaction()).get_lines('2')
 
266
        lines = self.branch.repository.weave_store.get_lines('fileid','2',
 
267
            self.branch.get_transaction())
269
268
        self.assertEqual(lines, ['contents of subdir/file\n'])
270
269
 
271
270
    def test_snapshot_unchanged(self):
277
276
                                  self.branch.get_transaction())
278
277
        self.assertEqual(self.file_1.revision, '1')
279
278
        self.assertEqual(self.file_active.revision, '1')
280
 
        vf = self.branch.repository.weave_store.get_weave(
281
 
            'fileid', 
282
 
            self.branch.repository.get_transaction())
283
279
        self.assertRaises(errors.RevisionNotPresent,
284
 
                          vf.get_lines,
285
 
                          '2')
 
280
                          self.branch.repository.weave_store.get_lines, 
 
281
                          'fileid', '2', self.branch.get_transaction())
286
282
 
287
283
    def test_snapshot_merge_identical_different_revid(self):
288
284
        # This tests that a commit with two identical parents, one of which has
352
348
        self.inv_D = self.branch.repository.get_inventory('D')
353
349
        self.file_active = self.wt.inventory['fileid']
354
350
        self.weave = self.branch.repository.weave_store.get_weave('fileid',
355
 
            self.branch.repository.get_transaction())
 
351
            self.branch.get_transaction())
356
352
        
357
353
    def get_previous_heads(self, inventories):
358
 
        return self.file_active.find_previous_heads(
359
 
            inventories, 
360
 
            self.branch.repository.weave_store,
361
 
            self.branch.repository.get_transaction())
 
354
        return self.file_active.find_previous_heads(inventories, self.weave)
362
355
        
363
356
    def test_fileid_in_no_inventory(self):
364
357
        self.assertEqual({}, self.get_previous_heads([self.inv_A]))
498
491
        os.unlink('b1/a')
499
492
        wt.revert([])
500
493
        self.assertEqual(len(wt.inventory), 1)
501
 
 
502