~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

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_lines('fileid','2',
267
 
            self.branch.get_transaction())
 
266
        lines = self.branch.repository.weave_store.get_weave(
 
267
            'fileid', 
 
268
            self.branch.get_transaction()).get_lines('2')
268
269
        self.assertEqual(lines, ['contents of subdir/file\n'])
269
270
 
270
271
    def test_snapshot_unchanged(self):
276
277
                                  self.branch.get_transaction())
277
278
        self.assertEqual(self.file_1.revision, '1')
278
279
        self.assertEqual(self.file_active.revision, '1')
279
 
        self.assertRaises(errors.WeaveError,
280
 
                          self.branch.repository.weave_store.get_lines, 
281
 
                          'fileid', '2', self.branch.get_transaction())
 
280
        vf = self.branch.repository.weave_store.get_weave(
 
281
            'fileid', 
 
282
            self.branch.repository.get_transaction())
 
283
        self.assertRaises(errors.RevisionNotPresent,
 
284
                          vf.get_lines,
 
285
                          '2')
282
286
 
283
287
    def test_snapshot_merge_identical_different_revid(self):
284
288
        # This tests that a commit with two identical parents, one of which has
292
296
        self.assertEqual(self.file_1, other_ie)
293
297
        other_ie.revision = 'other'
294
298
        self.assertNotEqual(self.file_1, other_ie)
295
 
        self.branch.repository.weave_store.add_identical_text('fileid', '1', 
296
 
            'other', ['1'], self.branch.get_transaction())
 
299
        versionfile = self.branch.repository.weave_store.get_weave(
 
300
            'fileid', self.branch.repository.get_transaction())
 
301
        versionfile.clone_text('other', '1', ['1'])
297
302
        self.file_active.snapshot('2', 'subdir/file', 
298
303
                                  {'1':self.file_1, 'other':other_ie},
299
304
                                  self.wt, 
490
495
        os.unlink('b1/a')
491
496
        wt.revert([])
492
497
        self.assertEqual(len(wt.inventory), 1)
 
498
 
 
499